This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git
The following commit(s) were added to refs/heads/develop by this push: new 2b890772 Fix the problem of slow service startup. (#1036) 2b890772 is described below commit 2b8907720df06b388afec3297963f5a1bb9908ac Author: wuwen <wuwen...@aliyun.com> AuthorDate: Tue Mar 21 13:12:11 2023 +0800 Fix the problem of slow service startup. (#1036) --- .../admin/registry/mapping/impl/NacosServiceMapping.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java index a7d25c91..9633ebb1 100644 --- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java +++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java @@ -40,7 +40,6 @@ import java.util.Set; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; import static com.alibaba.nacos.api.PropertyKeyConst.NAMING_LOAD_CACHE_AT_START; import static org.apache.dubbo.common.constants.RegistryConstants.CONFIGURATORS_CATEGORY; @@ -94,15 +93,6 @@ public class NacosServiceMapping implements ServiceMapping { @Override public void listenerAll() { - - try { - anyServices = getAllServiceNames().stream().filter(this::filterApplication).collect(Collectors.toSet()); - } catch (Exception e) { - LOGGER.error("Get nacos all services fail ", e); - } - for (String service : anyServices) { - notifyMappingChangedEvent(service); - } scheduledExecutorService.scheduleAtFixedRate(() -> { try { Set<String> serviceNames = getAllServiceNames(); @@ -115,7 +105,7 @@ public class NacosServiceMapping implements ServiceMapping { LOGGER.error("Get nacos all services fail ", e); } - }, LOOKUP_INTERVAL, LOOKUP_INTERVAL, TimeUnit.SECONDS); + }, 0, LOOKUP_INTERVAL, TimeUnit.SECONDS); } private Set<String> getAllServiceNames() throws NacosException {