Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat: add pre ping for sqlalchemy configuration (#4454)

takatostd8f38f79f212
diff --git a/api/config.py b/api/config.py
index eba27c7c708..10c0c7e8783 100644
--- a/api/config.py
+++ b/api/config.py
@@ -32,6 +32,7 @@ DEFAULTS = {
'SQLALCHEMY_POOL_SIZE': 30,
'SQLALCHEMY_MAX_OVERFLOW': 10,
'SQLALCHEMY_POOL_RECYCLE': 3600,
+ 'SQLALCHEMY_POOL_PRE_PING': 'False',
'SQLALCHEMY_ECHO': 'False',
'SENTRY_TRACES_SAMPLE_RATE': 1.0,
'SENTRY_PROFILES_SAMPLE_RATE': 1.0,
@@ -174,7 +175,8 @@ class Config:
self.SQLALCHEMY_ENGINE_OPTIONS = {
'pool_size': int(get_env('SQLALCHEMY_POOL_SIZE')),
'max_overflow': int(get_env('SQLALCHEMY_MAX_OVERFLOW')),
- 'pool_recycle': int(get_env('SQLALCHEMY_POOL_RECYCLE'))
+ 'pool_recycle': int(get_env('SQLALCHEMY_POOL_RECYCLE')),
+ 'pool_pre_ping': get_bool_env('SQLALCHEMY_POOL_PRE_PING')
}
self.SQLALCHEMY_ECHO = get_bool_env('SQLALCHEMY_ECHO')