From 279e4792a7853e7d22bd7adaf17567105000e372 Mon Sep 17 00:00:00 2001 From: Boris Arzentar Date: Tue, 1 Oct 2024 19:43:17 +0200 Subject: [PATCH] fix: await data and system prune --- cognee/api/client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cognee/api/client.py b/cognee/api/client.py index 84e7473e6..90d9a8876 100644 --- a/cognee/api/client.py +++ b/cognee/api/client.py @@ -34,13 +34,12 @@ from contextlib import asynccontextmanager async def lifespan(app: FastAPI): 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 - asyncio.run(prune_data()) - asyncio.run(prune_system(metadata = True)) + await prune_data() + await prune_system(metadata = True) + # Not needed if you setup a migration system like Alembic await create_db_and_tables() yield