Skip to content

Commit

Permalink
Revert "Fix: iteration not in main thread pool" (#11358)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywoola authored Dec 4, 2024
1 parent 961e25f commit d56abec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/core/workflow/nodes/iteration/iteration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]:
variable_pool.add([self.node_id, "item"], iterator_list_value[0])

# init graph engine
from core.workflow.graph_engine.graph_engine import GraphEngine
from core.workflow.graph_engine.graph_engine import GraphEngine, GraphEngineThreadPool

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

0 comments on commit d56abec

Please sign in to comment.