style: clean up code formatting and add missing newline in profiler.py

This commit is contained in:
grillazz
2026-02-05 11:53:29 +01:00
parent 81fcfad62d
commit 447e4e941c
4 changed files with 6 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ router = APIRouter()
@router.get("/redis", status_code=status.HTTP_200_OK)
async def redis_check(
request: Request,
pyprofile: Annotated[
pyprofile: Annotated[ # noqa: ARG001
bool, Query(description="Enable profiler for this request")
] = False,
):

View File

@@ -48,9 +48,9 @@ async def lifespan(app: FastAPI):
middleware = [
Middleware(GZipMiddleware),
Middleware(ProfilingMiddleware),
]
Middleware(GZipMiddleware),
Middleware(ProfilingMiddleware),
]
def create_app() -> FastAPI:
@@ -78,8 +78,6 @@ def create_app() -> FastAPI:
# Register exception handlers
register_exception_handlers(app)
@app.get("/index", response_class=HTMLResponse)
def get_index(request: Request):
return templates.TemplateResponse("index.html", {"request": request})

View File

@@ -25,4 +25,4 @@ class ProfilingMiddleware(BaseHTTPMiddleware):
headers={"Content-Disposition": "attachment; filename=profile.html"},
)
return await call_next(request)
return await call_next(request)

View File

@@ -21,6 +21,7 @@ from app.redis import get_redis
def anyio_backend(request):
return request.param
def _create_db(conn) -> None:
"""Create the test database if it doesn't exist."""
try: