From e4ddac872b528565d4eb0e9f2eb385da0ed45f4c Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 12 Oct 2025 15:34:04 +0200 Subject: [PATCH] Actually start the background thread to check db health --- src/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index fb69bcb..0650a95 100644 --- a/src/main.py +++ b/src/main.py @@ -6,7 +6,7 @@ from typing import Optional,List from pydantic import BaseModel from validator import is_valid_platform,is_valid_token,verify_api_key from secret_handler import encrypt_token -from db import get_db, create_connection_pool, close_connection_pool +from db import get_db, create_connection_pool, close_connection_pool, start_healthcheck_thread from logger_handler import setup_logger import uuid from hashlib import sha256 @@ -41,6 +41,8 @@ async def lifespan(app: FastAPI): logger.info("Creating MySQL connection pool...") create_connection_pool() + start_healthcheck_thread() + logger.info("MySQL healthcheck thread started.") yield logger.info("Closing MySQL connection pool...") close_connection_pool()