Skip to content

Commit

Permalink
feat:support concurrency rate limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman committed Nov 4, 2024
1 parent fa4e4d4 commit b295c3d
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ private MetadataContextHolder() {
}

public static MetadataContext get() {
try {
return (MetadataContext) com.tencent.polaris.metadata.core.manager.MetadataContextHolder.getOrCreate();
}
catch (Throwable throwable) {
LOG.error("Failed to get or create MetadataContext.", throwable);
return null;
}
return (MetadataContext) com.tencent.polaris.metadata.core.manager.MetadataContextHolder.getOrCreate();
}

private static MetadataContext createMetadataManager() {
MetadataContext metadataManager = new MetadataContext();
if (staticMetadataManager == null) {
staticMetadataManager = ApplicationContextAwareUtils.getApplicationContext()
.getBean(StaticMetadataManager.class);
if (ApplicationContextAwareUtils.getApplicationContext() != null) {
staticMetadataManager = ApplicationContextAwareUtils.getApplicationContext()
.getBean(StaticMetadataManager.class);
}
else {
// for junit test.
return metadataManager;
}
}
// local custom metadata
MetadataContainer metadataContainer = metadataManager.getMetadataContainer(MetadataType.CUSTOM, false);
Expand Down

0 comments on commit b295c3d

Please sign in to comment.