Fix async issues in namespace init

This commit is contained in:
yangdx
2025-03-09 15:22:06 +08:00
parent 6a969e8de4
commit 90527875fd
3 changed files with 12 additions and 10 deletions

View File

@@ -29,7 +29,7 @@ class JsonKVStorage(BaseKVStorage):
async def initialize(self):
"""Initialize storage data"""
# check need_init must before get_namespace_data
need_init = try_initialize_namespace(self.namespace)
need_init = await try_initialize_namespace(self.namespace)
self._data = await get_namespace_data(self.namespace)
if need_init:
loaded_data = load_json(self._file_name) or {}