From d81f865ec228439680aaf1d0f2d4e02f39524520 Mon Sep 17 00:00:00 2001 From: luxferre Date: Wed, 13 May 2026 12:41:26 +0100 Subject: [PATCH] feat: lifetime check for mis_handler existence --- src/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 5b1b615..7717625 100644 --- a/src/main.py +++ b/src/main.py @@ -18,6 +18,7 @@ from src.auth.config import auth_settings from src.misp.service import MISPHandler # TODO: Create Pydantic request/response schemas +# TODO: Untie MISP connection from app loading @asynccontextmanager @@ -25,7 +26,8 @@ async def lifespan(_application: FastAPI) -> AsyncGenerator: # Startup yield # Shutdown - _application.misp_handler.stop_timer() + if hasattr(_application, "misp_handler"): + _application.misp_handler.stop_timer() if settings.ENVIRONMENT.is_deployed: