Improved database connection and logging

This commit is contained in:
florian committed 2025-10-12 13:19:30 +02:00
1 parent 519e13f045
commit c89804b7b3
5 files changed
+114 -21

No files matched your search

+4 -1
View File
@@ -4,7 +4,7 @@ from github_api import find_package_version_with_tag as find_package_version_wit
from dockerhub_api import find_package_version_with_tag as find_package_version_with_tag_dockerhub
import uvicorn
from contextlib import asynccontextmanager
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
import logging
from send_notification import send_notification
from metrics_server import REQUEST_COUNTER
@@ -19,6 +19,9 @@ 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()