1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Merge pull request #2113 from terminux/master

修复当实例不在默认分组下时获取不到实例状态的BUG
This commit is contained in:
TheoneFx 2021-06-18 17:00:50 +08:00 committed by GitHub
commit 2a8647c263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()) {