diff --git a/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulRegistry.java b/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulRegistry.java index 9a174bbfd..be881f6e6 100644 --- a/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulRegistry.java +++ b/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulRegistry.java @@ -212,13 +212,13 @@ protected String discoverCommand(URL url) { } private ConcurrentHashMap> lookupServiceUpdate(String group) { + ConcurrentHashMap> groupUrls = new ConcurrentHashMap>(); Long lastConsulIndexId = lookupGroupServices.get(group) == null ? 0 : lookupGroupServices.get(group); ConsulResponse> response = lookupConsulService(group, lastConsulIndexId); if (response != null) { List services = response.getValue(); if (services != null && !services.isEmpty() && response.getConsulIndex() > lastConsulIndexId) { - ConcurrentHashMap> groupUrls = new ConcurrentHashMap>(); for (ConsulService service : services) { try { URL url = ConsulUtils.buildUrl(service); @@ -239,7 +239,7 @@ private ConcurrentHashMap> lookupServiceUpdate(String group) { LoggerUtil.info(group + " no need update, lastIndex:" + lastConsulIndexId); } } - return null; + return groupUrls; } private String lookupCommandUpdate(String group) {