Persistence cache data to disk before exiting
This commit is contained in:
parent
0ecae90002
commit
40a2357c14
1 changed files with 7 additions and 0 deletions
|
|
@ -197,3 +197,10 @@ class JsonKVStorage(BaseKVStorage):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error dropping {self.namespace}: {e}")
|
logger.error(f"Error dropping {self.namespace}: {e}")
|
||||||
return {"status": "error", "message": str(e)}
|
return {"status": "error", "message": str(e)}
|
||||||
|
|
||||||
|
async def finalize(self):
|
||||||
|
"""Finalize storage resources
|
||||||
|
Persistence cache data to disk before exiting
|
||||||
|
"""
|
||||||
|
if self.namespace.endswith("cache"):
|
||||||
|
await self.index_done_callback()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue