mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
fix: fix db env not work (#30541)
This commit is contained in:
parent
693daea474
commit
e3e19c437a
@ -53,3 +53,10 @@ def _setup_gevent_compatibility():
|
|||||||
def init_app(app: DifyApp):
|
def init_app(app: DifyApp):
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
_setup_gevent_compatibility()
|
_setup_gevent_compatibility()
|
||||||
|
|
||||||
|
# Eagerly build the engine so pool_size/max_overflow/etc. come from config
|
||||||
|
try:
|
||||||
|
with app.app_context():
|
||||||
|
_ = db.engine # triggers engine creation with the configured options
|
||||||
|
except Exception:
|
||||||
|
logger.exception("Failed to initialize SQLAlchemy engine during app startup")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user