Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid dup refresh for registry config #3135

Merged
merged 4 commits into from
Jan 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ protected void checkMetadataReport() {
*/
protected List<URL> loadRegistries(boolean provider) {
// check && override if necessary
checkRegistry();
List<URL> registryList = new ArrayList<URL>();
if (registries != null && !registries.isEmpty()) {
for (RegistryConfig config : registries) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public void checkAndUpdateSubConfigs() {
inheritIfAbsentFromApplication();
}
checkApplication();
checkRegistry();
checkMetadataReport();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public void checkApplication2() throws Exception {
public void testLoadRegistries() throws Exception {
System.setProperty("dubbo.registry.address", "addr1");
InterfaceConfig interfaceConfig = new InterfaceConfig();
// FIXME: now we need to check first, then load
interfaceConfig.checkRegistry();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should give loadRegistries another name that can better reflect what it does. It is misleading since it loads nothing except for converts RegistryConfigs to URLs.

List<URL> urls = interfaceConfig.loadRegistries(true);
TestCase.assertEquals(1, urls.size());
URL url = urls.get(0);
Expand Down