producers, consumers, rabbit_client

This commit is contained in:
2026-09-06 18:12:59 +03:00
parent d707c8b329
commit 10ce1755bd
14 changed files with 428 additions and 23 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
from contextlib import asynccontextmanager
from pathlib import Path
# import uvicorn
from fastapi import FastAPI
from src.cache.redis_client import redis_client
from src.database.users.crud import Seed
from src.logging.logger import LoggingMiddleware, ProcessingTimeMiddleware
from src.messaging.rabbitmq_client import rabbitmq_client
from src.web.protected_routes.auth_routes import router as protected_router
from src.web.protected_routes.protected_user_action_routes import (
router as protected_user_action_routes,
@@ -19,7 +19,7 @@ async def lifespan(app: FastAPI):
await create_first_user()
yield
await redis_client.close()
await rabbitmq_client.close()
app=FastAPI(root_path="/", lifespan=lifespan)
app.add_middleware(LoggingMiddleware)