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: db connections not being released during workflow execution (#3971)

takatostb82a2d97ef92
diff --git a/api/core/app/apps/workflow/generate_task_pipeline.py b/api/core/app/apps/workflow/generate_task_pipeline.py
index 9ccafa447d4..a7061a77bb8 100644
--- a/api/core/app/apps/workflow/generate_task_pipeline.py
+++ b/api/core/app/apps/workflow/generate_task_pipeline.py
@@ -380,6 +380,8 @@ class WorkflowAppGenerateTaskPipeline(BasedGenerateTaskPipeline, WorkflowCycleMa
self._task_state.answer += text
yield self._text_chunk_to_stream_response(text)
+ db.session.close()
+
def _is_stream_out_support(self, event: QueueTextChunkEvent) -> bool:
"""
Is stream out support