fix: await data and system prune
This commit is contained in:
parent
3e88a314d8
commit
279e4792a7
1 changed files with 3 additions and 4 deletions
|
|
@ -34,13 +34,12 @@ from contextlib import asynccontextmanager
|
||||||
async def lifespan(app: FastAPI):
|
async def lifespan(app: FastAPI):
|
||||||
from cognee.infrastructure.databases.relational import create_db_and_tables
|
from cognee.infrastructure.databases.relational import create_db_and_tables
|
||||||
|
|
||||||
# Not needed if you setup a migration system like Alembic
|
|
||||||
|
|
||||||
import asyncio
|
|
||||||
from cognee.modules.data.deletion import prune_system, prune_data
|
from cognee.modules.data.deletion import prune_system, prune_data
|
||||||
asyncio.run(prune_data())
|
await prune_data()
|
||||||
asyncio.run(prune_system(metadata = True))
|
await prune_system(metadata = True)
|
||||||
|
|
||||||
|
# Not needed if you setup a migration system like Alembic
|
||||||
await create_db_and_tables()
|
await create_db_and_tables()
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue