mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
fix
This commit is contained in:
parent
f60cb805c8
commit
b35c05e4fc
@ -22,6 +22,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.NacosServiceManager;
|
||||
@ -51,6 +52,8 @@ public class NacosWatch implements ApplicationEventPublisherAware, SmartLifecycl
|
||||
|
||||
private final AtomicBoolean running = new AtomicBoolean(false);
|
||||
|
||||
private final AtomicLong nacosWatchIndex = new AtomicLong(0);
|
||||
|
||||
private ApplicationEventPublisher publisher;
|
||||
|
||||
private NacosServiceManager nacosServiceManager;
|
||||
@ -93,9 +96,9 @@ public class NacosWatch implements ApplicationEventPublisherAware, SmartLifecycl
|
||||
instances);
|
||||
instanceOptional.ifPresent(currentInstance -> {
|
||||
resetIfNeeded(currentInstance);
|
||||
publisher.publishEvent(
|
||||
new HeartbeatEvent(this, currentInstance));
|
||||
});
|
||||
publisher.publishEvent(
|
||||
new HeartbeatEvent(NacosWatch.this, nacosWatchIndex.getAndIncrement()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user