Co-authored-by: Zhang Cheng <chengzhang@natureself.cn> Co-authored-by: Kevin Burnett <18027+burnettk@users.noreply.github.com>
This commit is contained in:
parent
0761505096
commit
8f86ff5f84
|
@ -72,8 +72,13 @@ def setup_database_configs(app: Flask) -> None:
|
|||
# this is a sqlalchemy default, if we don't have any better ideas
|
||||
pool_size = 5
|
||||
|
||||
pool_pre_ping = app.config.get("SPIFFWORKFLOW_BACKEND_DATABASE_POOL_PRE_PING")
|
||||
if pool_pre_ping is None:
|
||||
pool_pre_ping = True
|
||||
|
||||
app.config["SQLALCHEMY_ENGINE_OPTIONS"] = {}
|
||||
app.config["SQLALCHEMY_ENGINE_OPTIONS"]["pool_size"] = pool_size
|
||||
app.config["SQLALCHEMY_ENGINE_OPTIONS"]["pool_pre_ping"] = pool_pre_ping
|
||||
|
||||
|
||||
def load_config_file(app: Flask, env_config_module: str) -> None:
|
||||
|
|
|
@ -107,6 +107,9 @@ config_from_env("SPIFFWORKFLOW_BACKEND_DATABASE_URI")
|
|||
config_from_env("SPIFFWORKFLOW_BACKEND_DATABASE_PASSWORD")
|
||||
# we only use this in one place, and it checks to see if it is None.
|
||||
config_from_env("SPIFFWORKFLOW_BACKEND_DATABASE_POOL_SIZE")
|
||||
# check sqlalchemy's doc for more info about pool_pre_ping:
|
||||
# https://docs.sqlalchemy.org/en/20/core/pooling.html#disconnect-handling-pessimistic
|
||||
config_from_env("SPIFFWORKFLOW_BACKEND_DATABASE_POOL_PRE_PING", default=True)
|
||||
|
||||
### open id
|
||||
config_from_env("SPIFFWORKFLOW_BACKEND_AUTHENTICATION_DISABLED", default=False)
|
||||
|
|
Loading…
Reference in New Issue