forked from phoenix-oss/llama-stack-mirror
init registry once (#450)
We are calling the initialize function on the registery in the common routing table impl, which is incorrect as the common routing table is the base class inherited by each resource's routing table. this change moves remove that and add the initialize to the creation, where it inits once server run. Co-authored-by: Dinesh Yeduguru <dineshyv@fb.com>
This commit is contained in:
parent
efe791bab7
commit
46f0b6606a
2 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -216,5 +216,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue