Merge pull request #3 from alibaba/develop

update
This commit is contained in:
fox 2019-09-04 16:19:18 +08:00 committed by GitHub
commit 9651284ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,5 @@
# spring
server.contextPath=/nacos
server.servlet.contextPath=/nacos
server.port=8848

View File

@ -50,7 +50,7 @@ public class HealthCheckProcessorDelegate implements HealthCheckProcessor {
String type = task.getCluster().getHealthChecker().getType();
HealthCheckProcessor processor = healthCheckProcessorMap.get(type);
if(processor == null){
processor = healthCheckProcessorMap.get("none");
processor = healthCheckProcessorMap.get(NoneHealthCheckProcessor.TYPE);
}
processor.process(task);

View File

@ -47,6 +47,8 @@ import static com.alibaba.nacos.naming.misc.Loggers.SRV_LOG;
@Component
public class HttpHealthCheckProcessor implements HealthCheckProcessor {
public static final String TYPE = "HTTP";
@Autowired
private SwitchDomain switchDomain;
@ -79,7 +81,7 @@ public class HttpHealthCheckProcessor implements HealthCheckProcessor {
@Override
public String getType() {
return "HTTP";
return TYPE;
}
@Override

View File

@ -45,6 +45,8 @@ import static com.alibaba.nacos.naming.misc.Loggers.SRV_LOG;
@Component
public class MysqlHealthCheckProcessor implements HealthCheckProcessor {
public static final String TYPE = "MYSQL";
@Autowired
private HealthCheckCommon healthCheckCommon;
@ -83,7 +85,7 @@ public class MysqlHealthCheckProcessor implements HealthCheckProcessor {
@Override
public String getType() {
return "MYSQL";
return TYPE;
}
@Override

View File

@ -26,12 +26,14 @@ import org.springframework.stereotype.Component;
@Component
public class NoneHealthCheckProcessor implements HealthCheckProcessor {
public static final String TYPE = "NONE";
@Override
public void process(HealthCheckTask task) {
}
@Override
public String getType() {
return "NONE";
return TYPE;
}
}

View File

@ -43,6 +43,8 @@ import static com.alibaba.nacos.naming.misc.Loggers.SRV_LOG;
@Component
public class TcpSuperSenseProcessor implements HealthCheckProcessor, Runnable {
public static final String TYPE = "TCP";
@Autowired
private HealthCheckCommon healthCheckCommon;
@ -420,6 +422,6 @@ public class TcpSuperSenseProcessor implements HealthCheckProcessor, Runnable {
@Override
public String getType() {
return "TCP";
return TYPE;
}
}