Merge pull request #2113 from terminux/master

修复当实例不在默认分组下时获取不到实例状态的BUG
pull/2120/head
TheoneFx 4 years ago committed by GitHub
commit 2a8647c263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -159,8 +159,9 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
public Object getStatus(Registration registration) {
String serviceName = registration.getServiceId();
String group = nacosDiscoveryProperties.getGroup();
try {
List<Instance> instances = namingService().getAllInstances(serviceName);
List<Instance> instances = namingService().getAllInstances(serviceName, group);
for (Instance instance : instances) {
if (instance.getIp().equalsIgnoreCase(nacosDiscoveryProperties.getIp())
&& instance.getPort() == nacosDiscoveryProperties.getPort()) {

Loading…
Cancel
Save