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.

Fix missing database commit in provider update handler (#24357)

-LAN-ad2c5411637f
diff --git a/api/events/event_handlers/update_provider_when_message_created.py b/api/events/event_handlers/update_provider_when_message_created.py
index 2ed42c71ea7..f01dd589003 100644
--- a/api/events/event_handlers/update_provider_when_message_created.py
+++ b/api/events/event_handlers/update_provider_when_message_created.py
@@ -188,7 +188,7 @@ def _execute_provider_updates(updates_to_perform: list[_ProviderUpdateOperation]
# Use SQLAlchemy's context manager for transaction management
# This automatically handles commit/rollback
- with Session(db.engine) as session:
+ with Session(db.engine) as session, session.begin():
# Use a single transaction for all updates
for update_operation in updates_to_perform:
filters = update_operation.filters