refactor: recycle db connection to avoid "the connection is closed" exception. (#3726) (#3727)

This commit is contained in:
shaohuzhang1 2025-07-23 17:40:39 +08:00 committed by GitHub
parent d1cd01f555
commit 5ba725ba18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,6 +113,7 @@ class Config(dict):
"USER": self.get('DB_USER'),
"PASSWORD": self.get('DB_PASSWORD'),
"ENGINE": self.get('DB_ENGINE'),
"CONN_MAX_AGE": 0,
"POOL_OPTIONS": {
"POOL_SIZE": 20,
"MAX_OVERFLOW": int(self.get('DB_MAX_OVERFLOW')),