mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-04 11:14:10 +08:00
feat(graph_engine): yield control to other threads before node run. (#17689)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
c9f18aae0f
commit
ec29bcf013
@ -641,6 +641,8 @@ class GraphEngine:
|
|||||||
try:
|
try:
|
||||||
# run node
|
# run node
|
||||||
retry_start_at = datetime.now(UTC).replace(tzinfo=None)
|
retry_start_at = datetime.now(UTC).replace(tzinfo=None)
|
||||||
|
# yield control to other threads
|
||||||
|
time.sleep(0.001)
|
||||||
generator = node_instance.run()
|
generator = node_instance.run()
|
||||||
for item in generator:
|
for item in generator:
|
||||||
if isinstance(item, GraphEngineEvent):
|
if isinstance(item, GraphEngineEvent):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user