Merge pull request #964 from fangjian0423/master

Add sidecar health check interval configuration item.
pull/973/head
format 5 years ago committed by GitHub
commit 1773b49872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-alibaba-sidecar</artifactId> <artifactId>spring-cloud-alibaba-sidecar</artifactId>
<name>spring-cloud-alibaba-sidecar</name> <name>Spring Cloud Alibaba Sidecar</name>
<description>An easy way to integrate polyglot apps for Spring Cloud Alibaba.</description> <description>An easy way to integrate polyglot apps for Spring Cloud Alibaba.</description>
<dependencies> <dependencies>

@ -71,7 +71,7 @@ public class SidecarHealthChecker {
this.sidecarDiscoveryClient.deregisterInstance(applicationName, ip, port); this.sidecarDiscoveryClient.deregisterInstance(applicationName, ip, port);
} }
}, 0, 30, TimeUnit.SECONDS); }, 0, sidecarProperties.getHealthCheckInterval(), TimeUnit.MILLISECONDS);
} }
} }

@ -51,6 +51,11 @@ public class SidecarProperties {
*/ */
private URI healthCheckUrl; private URI healthCheckUrl;
/**
* interval of health check.
*/
private long healthCheckInterval = 30000L;
public String getIp() { public String getIp() {
return ip; return ip;
} }
@ -75,4 +80,12 @@ public class SidecarProperties {
this.healthCheckUrl = healthCheckUrl; this.healthCheckUrl = healthCheckUrl;
} }
public long getHealthCheckInterval() {
return healthCheckInterval;
}
public void setHealthCheckInterval(long healthCheckInterval) {
this.healthCheckInterval = healthCheckInterval;
}
} }

Loading…
Cancel
Save