fix error
This commit is contained in:
parent
ef557e7b68
commit
8e79c4731b
|
|
@ -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:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue