fix error
This commit is contained in:
parent
ef557e7b68
commit
8e79c4731b
|
|
@ -5,7 +5,8 @@
|
||||||
"Bash(grep:*)",
|
"Bash(grep:*)",
|
||||||
"Bash(.venvScriptspython -m pytest tests/test_security.py -v --tb=short)",
|
"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(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()
|
await init_db()
|
||||||
|
|
||||||
# TEMPORARY: Clean up old deleted assets (remove this after first run)
|
# 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
|
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.execute(text("DELETE FROM assets WHERE status = 'deleted'"))
|
||||||
await session.commit()
|
await session.commit()
|
||||||
break
|
|
||||||
# END TEMPORARY
|
# END TEMPORARY
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue