Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
呈铭 committed Mar 1, 2024
1 parent cf37047 commit c5b0eac
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,17 @@ public synchronized void init() {
nacosConfig.putAll(parameters);
}

lock.lock();
try {
if (providerObserver == null) {
lock.lock();
try {
if (providerObserver == null) {
providerObserver = new NacosRegistryProviderObserver();
}
} finally {
lock.unlock();
}
providerObserver = new NacosRegistryProviderObserver();
}

namingService = NamingFactory.createNamingService(nacosConfig);
} catch (NacosException e) {
throw new SofaRpcRuntimeException(LogCodes.getLog(LogCodes.ERROR_INIT_NACOS_NAMING_SERVICE, address), e);
}finally {
lock.unlock();
}
}

Expand Down

0 comments on commit c5b0eac

Please sign in to comment.