fix error

This commit is contained in:
itqop 2025-12-30 23:11:09 +03:00
parent ef557e7b68
commit 8e79c4731b
2 changed files with 4 additions and 4 deletions

View File

@ -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:*)"
]
}
}

View File

@ -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