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

do some optimizations about GenericService

This commit is contained in:
fangjian0423 2019-09-29 16:36:02 +08:00
parent 4d5b0fd191
commit 3b6220dd48

View File

@ -289,9 +289,7 @@ public class DubboServiceMetadataRepository
serviceName);
}
// Keep the order in following invocations
initSubscribedDubboMetadataService(serviceName);
initDubboRestServiceMetadataRepository(serviceName);
// mark this service name having been initialized
initializedServices.add(serviceName);
}
@ -392,9 +390,11 @@ public class DubboServiceMetadataRepository
return emptyList();
}
return hasText(protocol) ? urls.stream()
.filter(url -> url.getProtocol().equalsIgnoreCase(protocol))
.collect(Collectors.toList()) : unmodifiableList(urls);
return hasText(protocol)
? urls.stream()
.filter(url -> url.getProtocol().equalsIgnoreCase(protocol))
.collect(Collectors.toList())
: unmodifiableList(urls);
}
/**
@ -630,6 +630,7 @@ public class DubboServiceMetadataRepository
}
});
});
initDubboRestServiceMetadataRepository(serviceName);
}
private void initSubscribedDubboMetadataServiceURL(URL dubboMetadataServiceURL) {