From ec4717e1f182e63df95dfeb8e434f4ae9540d0af Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 3 Aug 2026 17:05:10 +0800 Subject: [PATCH] fix: connect pool pre ping --- backend/apps/db/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/apps/db/db.py b/backend/apps/db/db.py index 8f27432c..7f19854d 100644 --- a/backend/apps/db/db.py +++ b/backend/apps/db/db.py @@ -147,7 +147,8 @@ def get_engine(ds: CoreDatasource, timeout: int = 0, use_pool: bool = False) -> db_config = { 'pool_size': conf.poolSize if conf.poolSize else 5, 'max_overflow': 20, - 'pool_recycle': 3600 + 'pool_recycle': 3600, + 'pool_pre_ping': True } if use_pool else { 'poolclass': NullPool }