Skip to content

Commit 2a448a8

Browse files
Nov1c444Novice Lee
andauthored
Fix: iteration not in main thread pool (langgenius#11271)
Co-authored-by: Novice Lee <[email protected]>
1 parent 7b86f8f commit 2a448a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api/core/workflow/nodes/iteration/iteration_node.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]:
116116
variable_pool.add([self.node_id, "item"], iterator_list_value[0])
117117

118118
# init graph engine
119-
from core.workflow.graph_engine.graph_engine import GraphEngine, GraphEngineThreadPool
119+
from core.workflow.graph_engine.graph_engine import GraphEngine
120120

121121
graph_engine = GraphEngine(
122122
tenant_id=self.tenant_id,
@@ -162,7 +162,8 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]:
162162
if self.node_data.is_parallel:
163163
futures: list[Future] = []
164164
q = Queue()
165-
thread_pool = GraphEngineThreadPool(max_workers=self.node_data.parallel_nums, max_submit_count=100)
165+
thread_pool = graph_engine.workflow_thread_pool_mapping[graph_engine.thread_pool_id]
166+
thread_pool._max_workers = self.node_data.parallel_nums
166167
for index, item in enumerate(iterator_list_value):
167168
future: Future = thread_pool.submit(
168169
self._run_single_iter_parallel,

0 commit comments

Comments
 (0)