Make max_submit_count configurable via Config (#11673)

This commit is contained in:
Kazuhisa Wada
2024-12-16 13:59:37 +09:00
committed by GitHub
parent 79801f5c30
commit 63f1dd7877
4 changed files with 25 additions and 3 deletions

View File

@@ -163,7 +163,9 @@ class IterationNode(BaseNode[IterationNodeData]):
if self.node_data.is_parallel:
futures: list[Future] = []
q: Queue = Queue()
thread_pool = GraphEngineThreadPool(max_workers=self.node_data.parallel_nums, max_submit_count=100)
thread_pool = GraphEngineThreadPool(
max_workers=self.node_data.parallel_nums, max_submit_count=dify_config.MAX_SUBMIT_COUNT
)
for index, item in enumerate(iterator_list_value):
future: Future = thread_pool.submit(
self._run_single_iter_parallel,