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 1fbbd58 commit 2409d0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 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
from typing import AsyncGenerator, Callable

import uvicorn
from fastapi import Depends, FastAPI, HTTPException, Request, status
Expand All @@ -12,6 +12,7 @@
from fastapi.openapi.utils import get_openapi
from fastapi.responses import HTMLResponse, JSONResponse
from fastapi.security import APIKeyCookie, APIKeyHeader
from starlette.responses import Response

from store.app.db import create_tables
from store.app.errors import (
Expand Down Expand Up @@ -81,9 +82,9 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:


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

Expand Down

0 comments on commit 2409d0f

Please sign in to comment.