From b8fdeb7873541c2ec1e8c658864f0263d7500a71 Mon Sep 17 00:00:00 2001 From: Dinesh Yeduguru Date: Wed, 13 Nov 2024 15:17:33 -0800 Subject: [PATCH] init registry once --- llama_stack/distribution/routers/routing_tables.py | 2 -- llama_stack/distribution/store/registry.py | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/llama_stack/distribution/routers/routing_tables.py b/llama_stack/distribution/routers/routing_tables.py index 8c1b0c1e7..1eee3dee2 100644 --- a/llama_stack/distribution/routers/routing_tables.py +++ b/llama_stack/distribution/routers/routing_tables.py @@ -64,8 +64,6 @@ class CommonRoutingTableImpl(RoutingTable): self.dist_registry = dist_registry async def initialize(self) -> None: - # Initialize the registry if not already done - await self.dist_registry.initialize() async def add_objects( objs: List[RoutableObjectWithProvider], provider_id: str, cls diff --git a/llama_stack/distribution/store/registry.py b/llama_stack/distribution/store/registry.py index bb87c81fa..ec10c893d 100644 --- a/llama_stack/distribution/store/registry.py +++ b/llama_stack/distribution/store/registry.py @@ -220,5 +220,6 @@ async def create_dist_registry( db_path=(DISTRIBS_BASE_DIR / image_name / "kvstore.db").as_posix() ) ) - - return CachedDiskDistributionRegistry(dist_kvstore), dist_kvstore + dist_registry = CachedDiskDistributionRegistry(dist_kvstore) + await dist_registry.initialize() + return dist_registry, dist_kvstore