Skip to content

Commit

Permalink
Pick from apache#7692 a507445
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed May 28, 2021
1 parent b48fe51 commit c441be8
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ public Page<ServiceInstance> getInstances(String serviceName, int offset, int pa
serviceInstances.add(serviceInstance);
}
}

if (healthyOnly) {
Iterator<ServiceInstance> instanceIterator = serviceInstances.iterator();
while (instanceIterator.hasNext()) {
ServiceInstance instance = instanceIterator.next();
if (!instance.isHealthy()) {
instanceIterator.remove();
}
}
}
} catch (KeeperException.NoNodeException e) {
logger.warn(p + " path not exist.", e);
}
Expand Down

0 comments on commit c441be8

Please sign in to comment.