mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
1. try执行后无catch 依然是return null
2. 变量后续没用到可定义到 try 内 3. 添加UP/DOWN 常量值
This commit is contained in:
@@ -32,6 +32,16 @@ public class NacosConfigHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
private final ConfigService configService;
|
||||
|
||||
/**
|
||||
* status up .
|
||||
*/
|
||||
private final String STATUS_UP = "UP";
|
||||
|
||||
/**
|
||||
* status down .
|
||||
*/
|
||||
private final String STATUS_DOWN = "DOWN";
|
||||
|
||||
public NacosConfigHealthIndicator(ConfigService configService) {
|
||||
this.configService = configService;
|
||||
}
|
||||
@@ -43,10 +53,10 @@ public class NacosConfigHealthIndicator extends AbstractHealthIndicator {
|
||||
// Set the status to Builder
|
||||
builder.status(status);
|
||||
switch (status) {
|
||||
case "UP":
|
||||
case STATUS_UP:
|
||||
builder.up();
|
||||
break;
|
||||
case "DOWN":
|
||||
case STATUS_DOWN:
|
||||
builder.down();
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user