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(graph_engine): yield control to other threads before node run. (#17689)

-LAN-ec29bcf01389
diff --git a/api/core/workflow/graph_engine/graph_engine.py b/api/core/workflow/graph_engine/graph_engine.py
index d0f3041d5d8..36273d8ec15 100644
--- a/api/core/workflow/graph_engine/graph_engine.py
+++ b/api/core/workflow/graph_engine/graph_engine.py
@@ -641,6 +641,8 @@ class GraphEngine:
try:
# run node
retry_start_at = datetime.now(UTC).replace(tzinfo=None)
+ # yield control to other threads
+ time.sleep(0.001)
generator = node_instance.run()
for item in generator:
if isinstance(item, GraphEngineEvent):