Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao committed Nov 12, 2024
1 parent 2409d0f commit 8c909f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions store/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from contextlib import asynccontextmanager
from pathlib import Path
from typing import AsyncGenerator, Callable
from typing import AsyncGenerator, Awaitable, Callable

import uvicorn
from fastapi import Depends, FastAPI, HTTPException, Request, status
Expand Down Expand Up @@ -82,9 +82,9 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:


@app.middleware("http")
async def log_requests(request: Request, call_next: Callable[[Request], Response]) -> Response:
async def log_requests(request: Request, call_next: Callable[[Request], Awaitable[Response]]) -> Response:
logger.info(f"Request: {request.method} {request.url}")
response = call_next(request)
response = await call_next(request)
logger.info(f"Response status: {response.status_code}")
return response

Expand Down

0 comments on commit 8c909f1

Please sign in to comment.