1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Revert "fix nacos heart beat unit, second to millisecond."

This reverts commit 0e388707
This commit is contained in:
horizonzy 2020-12-23 09:51:42 +08:00
parent 0e38870735
commit 802958b218

View File

@ -19,7 +19,6 @@ package com.alibaba.cloud.nacos.registry;
import java.net.URI; import java.net.URI;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
@ -100,15 +99,15 @@ public class NacosRegistration implements Registration, ServiceInstance {
if (null != nacosDiscoveryProperties.getHeartBeatInterval()) { if (null != nacosDiscoveryProperties.getHeartBeatInterval()) {
metadata.put(PreservedMetadataKeys.HEART_BEAT_INTERVAL, metadata.put(PreservedMetadataKeys.HEART_BEAT_INTERVAL,
String.valueOf(TimeUnit.SECONDS.toMillis(nacosDiscoveryProperties.getHeartBeatInterval()))); nacosDiscoveryProperties.getHeartBeatInterval().toString());
} }
if (null != nacosDiscoveryProperties.getHeartBeatTimeout()) { if (null != nacosDiscoveryProperties.getHeartBeatTimeout()) {
metadata.put(PreservedMetadataKeys.HEART_BEAT_TIMEOUT, metadata.put(PreservedMetadataKeys.HEART_BEAT_TIMEOUT,
String.valueOf(TimeUnit.SECONDS.toMillis(nacosDiscoveryProperties.getHeartBeatTimeout()))); nacosDiscoveryProperties.getHeartBeatTimeout().toString());
} }
if (null != nacosDiscoveryProperties.getIpDeleteTimeout()) { if (null != nacosDiscoveryProperties.getIpDeleteTimeout()) {
metadata.put(PreservedMetadataKeys.IP_DELETE_TIMEOUT, metadata.put(PreservedMetadataKeys.IP_DELETE_TIMEOUT,
String.valueOf(TimeUnit.SECONDS.toMillis(nacosDiscoveryProperties.getIpDeleteTimeout()))); nacosDiscoveryProperties.getIpDeleteTimeout().toString());
} }
customize(registrationCustomizers, this); customize(registrationCustomizers, this);
} }