diff --git a/.claude/settings.local.json b/.claude/settings.local.json index f49e006..6d9ac84 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -5,7 +5,8 @@ "Bash(grep:*)", "Bash(.venvScriptspython -m pytest tests/test_security.py -v --tb=short)", "Bash(cmd.exe /c \"cd c:\\\\Users\\\\leonk\\\\Documents\\\\code\\\\itcloud\\\\backend && ..\\\\.venv\\\\Scripts\\\\python -m pytest tests/test_security.py -v --tb=short\")", - "Bash(../\".venv/Scripts/python.exe\" -m pytest tests/test_security.py -v --tb=short)" + "Bash(../\".venv/Scripts/python.exe\" -m pytest tests/test_security.py -v --tb=short)", + "Bash(python -m py_compile:*)" ] } } diff --git a/backend/src/app/main.py b/backend/src/app/main.py index 03a5ccb..8cc23dc 100644 --- a/backend/src/app/main.py +++ b/backend/src/app/main.py @@ -19,12 +19,11 @@ async def lifespan(app: FastAPI): await init_db() # TEMPORARY: Clean up old deleted assets (remove this after first run) - from app.infra.database import get_session + from app.infra.database import AsyncSessionLocal from sqlalchemy import text - async for session in get_session(): + async with AsyncSessionLocal() as session: await session.execute(text("DELETE FROM assets WHERE status = 'deleted'")) await session.commit() - break # END TEMPORARY yield