fix something
This commit is contained in:
parent
c137994384
commit
6dc3882eef
@ -36,7 +36,7 @@ if not "%2" == "cluster" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
set "JAVA_OPT=%JAVA_OPT% -Dnacos.home=%BASE_DIR%"
|
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% --spring.config.location=%CUSTOM_SEARCH_LOCATIONS%"
|
||||||
set "JAVA_OPT=%JAVA_OPT% --logging.config=%BASE_DIR%/conf/nacos-logback.xml"
|
set "JAVA_OPT=%JAVA_OPT% --logging.config=%BASE_DIR%/conf/nacos-logback.xml"
|
||||||
|
|
||||||
|
@ -121,15 +121,15 @@ public class HealthController {
|
|||||||
@RequestMapping(value = "checkers", method = RequestMethod.GET)
|
@RequestMapping(value = "checkers", method = RequestMethod.GET)
|
||||||
public ResponseEntity checkers(){
|
public ResponseEntity checkers(){
|
||||||
List<Class> classes = HealthCheckType.getLoadedHealthCheckerClasses();
|
List<Class> classes = HealthCheckType.getLoadedHealthCheckerClasses();
|
||||||
Map<String, AbstractHealthChecker> demos = new HashMap<>(8);
|
Map<String, AbstractHealthChecker> checkerMap = new HashMap<>(8);
|
||||||
for(Class clazz : classes){
|
for(Class clazz : classes){
|
||||||
try {
|
try {
|
||||||
AbstractHealthChecker checker = (AbstractHealthChecker) clazz.newInstance();
|
AbstractHealthChecker checker = (AbstractHealthChecker) clazz.newInstance();
|
||||||
demos.put(checker.getType(), checker);
|
checkerMap.put(checker.getType(), checker);
|
||||||
} catch (InstantiationException | IllegalAccessException e) {
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ResponseEntity.ok(demos);
|
return ResponseEntity.ok(checkerMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user