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 # spring
server.contextPath=/nacos
server.servlet.contextPath=/nacos server.servlet.contextPath=/nacos
server.port=8848 server.port=8848

View File

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

View File

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

View File

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

View File

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

View File

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