From 8fb94d4dde347507245a2d22da75e3b1b61ecfa4 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 20 Jan 2025 20:41:56 +1300 Subject: [PATCH] recycle db connection pool --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index ba44ceed..f391338b 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -32,7 +32,7 @@ def get_locale(): return 'en' -db = SQLAlchemy(session_options={"autoflush": False}, engine_options={'pool_size': Config.DB_POOL_SIZE, 'max_overflow': Config.DB_MAX_OVERFLOW}) # engine_options={'pool_size': 5, 'max_overflow': 10} # session_options={"autoflush": False} +db = SQLAlchemy(session_options={"autoflush": False}, engine_options={'pool_size': Config.DB_POOL_SIZE, 'max_overflow': Config.DB_MAX_OVERFLOW, 'pool_recycle': 3600}) migrate = Migrate() login = LoginManager() login.login_view = 'auth.login'