From 6ebac01c618c66825fd42f7246e25fcd46a7c310 Mon Sep 17 00:00:00 2001 From: swve Date: Sun, 16 Mar 2025 11:18:38 +0100 Subject: [PATCH] chore: update database connection settings with pool size and timeout configurations --- apps/api/src/core/events/database.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/api/src/core/events/database.py b/apps/api/src/core/events/database.py index 67a199ef..6733dd81 100644 --- a/apps/api/src/core/events/database.py +++ b/apps/api/src/core/events/database.py @@ -35,7 +35,11 @@ learnhouse_config = get_learnhouse_config() engine = create_engine( learnhouse_config.database_config.sql_connection_string, # type: ignore echo=False, - pool_pre_ping=True # type: ignore + pool_pre_ping=True, # type: ignore + pool_size=10, + max_overflow=20, + pool_recycle=300, # Recycle connections after 5 minutes + pool_timeout=30 ) # Create all tables after importing all models