mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 09:15:54 +08:00
Fix: iteration not in main thread pool (#11271)
Co-authored-by: Novice Lee <novicelee@NovicedeMacBook-Pro.local>
This commit is contained in:
parent
7b86f8f024
commit
2a448a899d
@ -116,7 +116,7 @@ class IterationNode(BaseNode[IterationNodeData]):
|
|||||||
variable_pool.add([self.node_id, "item"], iterator_list_value[0])
|
variable_pool.add([self.node_id, "item"], iterator_list_value[0])
|
||||||
|
|
||||||
# init graph engine
|
# init graph engine
|
||||||
from core.workflow.graph_engine.graph_engine import GraphEngine, GraphEngineThreadPool
|
from core.workflow.graph_engine.graph_engine import GraphEngine
|
||||||
|
|
||||||
graph_engine = GraphEngine(
|
graph_engine = GraphEngine(
|
||||||
tenant_id=self.tenant_id,
|
tenant_id=self.tenant_id,
|
||||||
@ -162,7 +162,8 @@ class IterationNode(BaseNode[IterationNodeData]):
|
|||||||
if self.node_data.is_parallel:
|
if self.node_data.is_parallel:
|
||||||
futures: list[Future] = []
|
futures: list[Future] = []
|
||||||
q = Queue()
|
q = Queue()
|
||||||
thread_pool = GraphEngineThreadPool(max_workers=self.node_data.parallel_nums, max_submit_count=100)
|
thread_pool = graph_engine.workflow_thread_pool_mapping[graph_engine.thread_pool_id]
|
||||||
|
thread_pool._max_workers = self.node_data.parallel_nums
|
||||||
for index, item in enumerate(iterator_list_value):
|
for index, item in enumerate(iterator_list_value):
|
||||||
future: Future = thread_pool.submit(
|
future: Future = thread_pool.submit(
|
||||||
self._run_single_iter_parallel,
|
self._run_single_iter_parallel,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user