diff --git a/src/backend/main.py b/src/backend/main.py index b7d3752f00..717e3f93dd 100644 --- a/src/backend/main.py +++ b/src/backend/main.py @@ -27,6 +27,7 @@ from backend.services.context import ContextMiddleware, get_context from backend.services.logger.middleware import LoggingMiddleware from backend.services.metrics import MetricsMiddleware +from structlog import get_logger load_dotenv() @@ -128,7 +129,7 @@ async def health(): @app.post("/migrate") -async def apply_migrations(request: Request): +async def apply_migrations(): """ Applies Alembic migrations - useful for serverless applications """ @@ -136,15 +137,11 @@ async def apply_migrations(request: Request): alembic_cfg = Config("src/backend/alembic.ini") upgrade(alembic_cfg, "head") except Exception as e: - ctx = get_context(request) - logger = ctx.get_logger() + logger = get_logger() logger.exception( event="Error while applying Alembic migrations", error=str(e), - method=request.method, - url=request.url, - ctx=ctx, ) raise HTTPException( status_code=500, detail=f"Error while applying Alembic migrations: {str(e)}"