mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2025-12-06 14:45:36 +01:00
Fix
This commit is contained in:
@@ -14,7 +14,6 @@ from core.taskiq_worker import broker
|
|||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def lifespan(app: FastAPI):
|
async def lifespan(app: FastAPI):
|
||||||
database = app.state.database
|
|
||||||
if not database.is_connected:
|
if not database.is_connected:
|
||||||
await database.connect()
|
await database.connect()
|
||||||
|
|
||||||
@@ -35,7 +34,6 @@ async def lifespan(app: FastAPI):
|
|||||||
def start_app() -> FastAPI:
|
def start_app() -> FastAPI:
|
||||||
app = FastAPI(default_response_class=ORJSONResponse, lifespan=lifespan)
|
app = FastAPI(default_response_class=ORJSONResponse, lifespan=lifespan)
|
||||||
|
|
||||||
app.state.database = database
|
|
||||||
app.state.redis_pool = ConnectionPool.from_url(REDIS_URL)
|
app.state.redis_pool = ConnectionPool.from_url(REDIS_URL)
|
||||||
|
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
|
|||||||
Reference in New Issue
Block a user