From 05e3755d65682f4ba092c84820c3eff993ac3442 Mon Sep 17 00:00:00 2001 From: michplunkett <5885605+michplunkett@users.noreply.github.com> Date: Fri, 14 Mar 2025 22:48:36 -0500 Subject: [PATCH] boop --- app/web/endpoints/task.py | 3 ++- app/web/middleware.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/web/endpoints/task.py b/app/web/endpoints/task.py index e9da444..3581ab2 100644 --- a/app/web/endpoints/task.py +++ b/app/web/endpoints/task.py @@ -26,7 +26,8 @@ def get_status( try: if task.status == "FAILURE": # *FAILURE* The task raised an exception, or has exceeded the retry limit. - # The :attr:`result` attribute then contains the exception raised by the task. + # The :attr:`result` attribute then contains the exception raised by + # the task. # https://docs.celeryq.dev/en/stable/_modules/celery/result.html#AsyncResult raise task.result diff --git a/app/web/middleware.py b/app/web/middleware.py index 47c07b3..b39ae01 100644 --- a/app/web/middleware.py +++ b/app/web/middleware.py @@ -10,7 +10,8 @@ from app.web.utils.metrics import EXCEPTION_COUNTER async def logging_middleware(request: Request, call_next): try: response = await call_next(request) - # TODO: use Origin to have summary prometheus metrics on where requests come from + # TODO: use Origin to have summary prometheus metrics on where + # requests come from # origin = request.headers.get("origin") logger.info( f"{request.client.host}:{request.client.port} {request.method} {request.url._url} - HTTP {response.status_code}" @@ -25,7 +26,9 @@ async def logging_middleware(request: Request, call_next): raise e -async def increase_exceptions_counter(e: Exception, location: str = "cronjob"): +async def increase_exceptions_counter( + e: Exception, location: str = "cronjob" +) -> None: if location == "cronjob": try: last_trace = traceback.extract_tb(e.__traceback__)[-1]