fix: 去掉多余的方法调用

This commit is contained in:
CaptainB 2022-03-15 14:47:09 +08:00 committed by 刘瑞斌
parent db1df5b8eb
commit 3995a64d9f
1 changed files with 0 additions and 7 deletions

View File

@ -66,7 +66,6 @@ public class CatalogApi {
@GetMapping("health/service/{service}")
@NoResultHolder
public ResponseEntity<JSONArray> health(@PathVariable String service) {
Map<String, List<String>> activeNodes = consulService.getActiveNodes();
int index = RandomUtils.nextInt(1000, 20000);
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.set("X-Consul-Default-Acl-Policy", "allow");
@ -74,12 +73,6 @@ public class CatalogApi {
responseHeaders.set("X-Consul-Knownleader", "true");
responseHeaders.set("X-Consul-Lastcontact", "0");
if (!activeNodes.containsKey(service)) {
return ResponseEntity.ok()
.headers(responseHeaders)
.body(JSON.parseArray("[]"));
}
int i = service.lastIndexOf("-");
String address = service.substring(0, i);
String port = service.substring(i + 1);