fix: 去掉多余的方法调用
This commit is contained in:
parent
db1df5b8eb
commit
3995a64d9f
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue