This commit is contained in:
parent
c42981c9e3
commit
44b0891d16
@ -188,18 +188,14 @@ public class ServiceInfo {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Instance> validHosts = new ArrayList<>();
|
||||
boolean existValidHosts = false;
|
||||
for (Instance host : hosts) {
|
||||
if (!host.isHealthy()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (host.getWeight() > 0) {
|
||||
validHosts.add(host);
|
||||
if (host.isHealthy() && host.getWeight() > 0) {
|
||||
existValidHosts = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//No valid hosts, return false.
|
||||
return !validHosts.isEmpty();
|
||||
return existValidHosts;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
|
Loading…
Reference in New Issue
Block a user