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:
Kevin Chung
2020-06-29 19:12:22 -04:00
committed by GitHub
parent b8eb679c2b
commit cbb3f727bc
2 changed files with 4 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ UPDATE_CHECK =
APPLICATION_ROOT =
SERVER_SENT_EVENTS =
SQLALCHEMY_MAX_OVERFLOW =
SQLALCHEMY_POOL_PRE_PING =
[oauth]
OAUTH_CLIENT_ID =

View File

@@ -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
}
"""