This commit is contained in:
2022-01-20 11:40:08 +03:00
parent 71258864d2
commit 2f222ee55d
10 changed files with 212 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
from fastapi import FastAPI
from app.views import router
from core.arq_pool import get_arq_pool
from core.db import database
@@ -17,6 +18,8 @@ def start_app() -> FastAPI:
if not database_.is_connected:
await database_.connect()
app.state.arq_pool = await get_arq_pool()
@app.on_event("shutdown")
async def shutdown() -> None:
database_ = app.state.database