|
|
@ -18,8 +18,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
package com.tencent.cloud.polaris.registry;
|
|
|
|
package com.tencent.cloud.polaris.registry;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
|
|
import com.tencent.cloud.common.metadata.config.MetadataLocalProperties;
|
|
|
|
import com.tencent.cloud.common.metadata.config.MetadataLocalProperties;
|
|
|
@ -71,13 +71,11 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
|
|
|
|
this.polarisDiscoveryProperties = polarisDiscoveryProperties;
|
|
|
|
this.polarisDiscoveryProperties = polarisDiscoveryProperties;
|
|
|
|
this.polarisDiscoveryHandler = polarisDiscoveryHandler;
|
|
|
|
this.polarisDiscoveryHandler = polarisDiscoveryHandler;
|
|
|
|
this.metadataLocalProperties = metadataLocalProperties;
|
|
|
|
this.metadataLocalProperties = metadataLocalProperties;
|
|
|
|
|
|
|
|
|
|
|
|
if (polarisDiscoveryProperties.isHeartbeatEnabled()) {
|
|
|
|
if (polarisDiscoveryProperties.isHeartbeatEnabled()) {
|
|
|
|
ScheduledThreadPoolExecutor heartbeatExecutor = new ScheduledThreadPoolExecutor(
|
|
|
|
this.heartbeatExecutor = Executors
|
|
|
|
0, new NamedThreadFactory("spring-cloud-heartbeat"));
|
|
|
|
.newSingleThreadScheduledExecutor(new NamedThreadFactory("spring-cloud-heartbeat"));
|
|
|
|
heartbeatExecutor.setMaximumPoolSize(1);
|
|
|
|
} else {
|
|
|
|
this.heartbeatExecutor = heartbeatExecutor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
this.heartbeatExecutor = null;
|
|
|
|
this.heartbeatExecutor = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|