diff --git a/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/GlobalAssetRegistry.java b/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/GlobalAssetRegistry.java index ba700c585..15a2d75f3 100644 --- a/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/GlobalAssetRegistry.java +++ b/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/GlobalAssetRegistry.java @@ -19,7 +19,6 @@ public class GlobalAssetRegistry { private final Map> registry = new ConcurrentHashMap<>(); private GlobalAssetRegistry() { - preLoadInternalAssets(); } // thread-safe, lazy-load singleton instance. @@ -27,6 +26,14 @@ private GlobalAssetRegistry() { // Putting it in the inner class makes this inner only being loaded when getInstance() is called. private static class InnerHolder { private static final GlobalAssetRegistry INSTANCE = new GlobalAssetRegistry(); + + static { + try { + INSTANCE.preLoadInternalAssets(); + } catch (Exception e) { + log.error("Failed to pre-load internal assets", e); + } + } } private static GlobalAssetRegistry getInstance() {