fix something

This commit is contained in:
XCXCXCXCX 2019-05-10 13:47:22 +08:00
parent c137994384
commit 6dc3882eef
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ if not "%2" == "cluster" (
)
set "JAVA_OPT=%JAVA_OPT% -Dnacos.home=%BASE_DIR%"
set "JAVA_OPT=%JAVA_OPT% -Dloader.path=%BASE_DIR%/plugins/health/nacos-health-plugin-example-1.0.jar -jar %BASE_DIR%\target\nacos-server.jar"
set "JAVA_OPT=%JAVA_OPT% -Dloader.path=%BASE_DIR%/plugins/health -jar %BASE_DIR%\target\nacos-server.jar"
set "JAVA_OPT=%JAVA_OPT% --spring.config.location=%CUSTOM_SEARCH_LOCATIONS%"
set "JAVA_OPT=%JAVA_OPT% --logging.config=%BASE_DIR%/conf/nacos-logback.xml"

View File

@ -121,15 +121,15 @@ public class HealthController {
@RequestMapping(value = "checkers", method = RequestMethod.GET)
public ResponseEntity checkers(){
List<Class> classes = HealthCheckType.getLoadedHealthCheckerClasses();
Map<String, AbstractHealthChecker> demos = new HashMap<>(8);
Map<String, AbstractHealthChecker> checkerMap = new HashMap<>(8);
for(Class clazz : classes){
try {
AbstractHealthChecker checker = (AbstractHealthChecker) clazz.newInstance();
demos.put(checker.getType(), checker);
checkerMap.put(checker.getType(), checker);
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
return ResponseEntity.ok(demos);
return ResponseEntity.ok(checkerMap);
}
}