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()