From d4d26d35a17897cd167dd3a06a3cae0cdccac4da Mon Sep 17 00:00:00 2001 From: itqop Date: Tue, 30 Dec 2025 23:23:33 +0300 Subject: [PATCH] fix logs --- backend/src/app/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/app/main.py b/backend/src/app/main.py index 0d394b0..7545fdc 100644 --- a/backend/src/app/main.py +++ b/backend/src/app/main.py @@ -21,19 +21,18 @@ async def lifespan(app: FastAPI): # TEMPORARY: Clean up old deleted assets (remove this after first run) from app.infra.database import AsyncSessionLocal from sqlalchemy import text - import logging - logger = logging.getLogger(__name__) async with AsyncSessionLocal() as session: # Check how many deleted assets exist result = await session.execute(text("SELECT COUNT(*) FROM assets WHERE status = 'deleted'")) count_before = result.scalar() - logger.info(f"Found {count_before} assets with status='deleted'") + print(f"[MIGRATION] Found {count_before} assets with status='deleted'") # Delete them result = await session.execute(text("DELETE FROM assets WHERE status = 'deleted'")) await session.commit() - logger.info(f"Deleted {result.rowcount} assets with status='deleted'") + print(f"[MIGRATION] Deleted {result.rowcount} assets with status='deleted'") + print("[MIGRATION] Migration complete - you can now remove this code from main.py") # END TEMPORARY yield