mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-14 02:34:23 +01:00
Enable pool_pre_ping on SQLAlchemy connections (#1520)
* Integrates SQLAlchemy `pool_pre_ping` to check SQLAlchemy connections on checkout. * Closes #1509, #1438, #1395, #467
This commit is contained in:
@@ -41,6 +41,7 @@ UPDATE_CHECK =
|
||||
APPLICATION_ROOT =
|
||||
SERVER_SENT_EVENTS =
|
||||
SQLALCHEMY_MAX_OVERFLOW =
|
||||
SQLALCHEMY_POOL_PRE_PING =
|
||||
|
||||
[oauth]
|
||||
OAUTH_CLIENT_ID =
|
||||
|
||||
@@ -340,6 +340,9 @@ class Config(object):
|
||||
"max_overflow": int(os.getenv("SQLALCHEMY_MAX_OVERFLOW", 0))
|
||||
or int(empty_str_cast(config_ini["optional"]["SQLALCHEMY_MAX_OVERFLOW"], default=0)) # noqa: E131
|
||||
or 20, # noqa: E131
|
||||
"pool_pre_ping": process_boolean_str(os.getenv("SQLALCHEMY_POOL_PRE_PING"))
|
||||
or empty_str_cast(config_ini["optional"]["SQLALCHEMY_POOL_PRE_PING"]) # noqa: E131
|
||||
or True, # noqa: E131
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user