mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge pull request #964 from fangjian0423/master
Add sidecar health check interval configuration item.
This commit is contained in:
commit
1773b49872
@ -9,7 +9,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<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>
|
||||
|
||||
<dependencies>
|
||||
|
@ -71,7 +71,7 @@ public class SidecarHealthChecker {
|
||||
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;
|
||||
|
||||
/**
|
||||
* interval of health check.
|
||||
*/
|
||||
private long healthCheckInterval = 30000L;
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
@ -75,4 +80,12 @@ public class SidecarProperties {
|
||||
this.healthCheckUrl = healthCheckUrl;
|
||||
}
|
||||
|
||||
public long getHealthCheckInterval() {
|
||||
return healthCheckInterval;
|
||||
}
|
||||
|
||||
public void setHealthCheckInterval(long healthCheckInterval) {
|
||||
this.healthCheckInterval = healthCheckInterval;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user