Actually start the background thread to check db health
All checks were successful
Build & Publish to GHCR / build (push) Successful in 28s
All checks were successful
Build & Publish to GHCR / build (push) Successful in 28s
This commit is contained in:
parent
85a58adc98
commit
e4ddac872b
@ -6,7 +6,7 @@ from typing import Optional,List
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from validator import is_valid_platform,is_valid_token,verify_api_key
|
from validator import is_valid_platform,is_valid_token,verify_api_key
|
||||||
from secret_handler import encrypt_token
|
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
|
from logger_handler import setup_logger
|
||||||
import uuid
|
import uuid
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
@ -41,6 +41,8 @@ async def lifespan(app: FastAPI):
|
|||||||
logger.info("Creating MySQL connection pool...")
|
logger.info("Creating MySQL connection pool...")
|
||||||
create_connection_pool()
|
create_connection_pool()
|
||||||
|
|
||||||
|
start_healthcheck_thread()
|
||||||
|
logger.info("MySQL healthcheck thread started.")
|
||||||
yield
|
yield
|
||||||
logger.info("Closing MySQL connection pool...")
|
logger.info("Closing MySQL connection pool...")
|
||||||
close_connection_pool()
|
close_connection_pool()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user