mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish alibaba/spring-cloud-alibaba#1369 : [Feature] Synchronizing source code to Spring Cloud Alibaba greenwich branch
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-starters</artifactId>
|
||||
<version>2.1.2.BUILD-SNAPSHOT</version>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@@ -61,7 +61,7 @@ public class SentinelHealthIndicator extends AbstractHealthIndicator {
|
||||
private SentinelProperties sentinelProperties;
|
||||
|
||||
public SentinelHealthIndicator(DefaultListableBeanFactory beanFactory,
|
||||
SentinelProperties sentinelProperties) {
|
||||
SentinelProperties sentinelProperties) {
|
||||
this.beanFactory = beanFactory;
|
||||
this.sentinelProperties = sentinelProperties;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class SentinelHealthIndicator extends AbstractHealthIndicator {
|
||||
// detail
|
||||
if (!sentinelProperties.isEnabled()) {
|
||||
detailMap.put("enabled", false);
|
||||
builder.up().withDetails(detailMap);
|
||||
withDetails(builder.up(), detailMap);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,11 +139,16 @@ public class SentinelHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
// If Dashboard and DataSource are both OK, the health status is UP
|
||||
if (dashboardUp && dataSourceUp) {
|
||||
builder.up().withDetails(detailMap);
|
||||
withDetails(builder.up(), detailMap);
|
||||
}
|
||||
else {
|
||||
builder.down().withDetails(detailMap);
|
||||
withDetails(builder.down(), detailMap);
|
||||
}
|
||||
}
|
||||
|
||||
private void withDetails(Health.Builder builder, Map<String, Object> detailMap) {
|
||||
for (String key : detailMap.keySet()) {
|
||||
builder.withDetail(key, detailMap.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user