Skip to content

Commit 39ae78f

Browse files
committed
remove synchronized
1 parent 8dad6b2 commit 39ae78f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

huawei-cloud/servicestage/src/main/java/org/apache/servicecomb/huaweicloud/servicestage/TokenCacheManager.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ public final class TokenCacheManager {
5656

5757
private TokenCache tokenCache;
5858

59-
private static final Object LOCK = new Object();
60-
6159
public static TokenCacheManager getInstance() {
6260
return INSTANCE;
6361
}
@@ -192,13 +190,11 @@ public String getToken(String host) {
192190
if (StringUtils.isEmpty(address)) {
193191
address = registryName;
194192
}
195-
synchronized (LOCK) {
196-
try {
197-
return cache.get(address);
198-
} catch (Exception e) {
199-
LOGGER.error("failed to create token", e);
200-
return null;
201-
}
193+
try {
194+
return cache.get(address);
195+
} catch (Exception e) {
196+
LOGGER.error("failed to create token", e);
197+
return null;
202198
}
203199
}
204200

0 commit comments

Comments
 (0)