implemented rate limit and set up redis container
This commit is contained in:
@@ -4,6 +4,7 @@ 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.web.protected_routes.auth_routes import router as protected_router
|
||||
@@ -17,6 +18,7 @@ async def lifespan(app: FastAPI):
|
||||
create_dirs()
|
||||
await create_first_user()
|
||||
yield
|
||||
await redis_client.close()
|
||||
|
||||
|
||||
app=FastAPI(root_path="/", lifespan=lifespan)
|
||||
|
||||
Reference in New Issue
Block a user