diff --git a/api/core/workflow/nodes/iteration/iteration_node.py b/api/core/workflow/nodes/iteration/iteration_node.py index a2c589f749..cb353215f9 100644 --- a/api/core/workflow/nodes/iteration/iteration_node.py +++ b/api/core/workflow/nodes/iteration/iteration_node.py @@ -188,7 +188,6 @@ class IterationNode(BaseNode[IterationNodeData]): q.put(None) yield event except Empty: - logger.warning("iteration parallel queue is empty.") continue # wait all threads diff --git a/web/app/components/workflow/constants.ts b/web/app/components/workflow/constants.ts index 794996d1bd..1d215f3fe4 100644 --- a/web/app/components/workflow/constants.ts +++ b/web/app/components/workflow/constants.ts @@ -340,7 +340,8 @@ export const NODES_INITIAL_DATA = { ...ListFilterDefault.defaultValue, }, } - +export const MAX_ITERATION_PARALLEL_NUM = 10 +export const MIN_ITERATION_PARALLEL_NUM = 1 export const NODE_WIDTH = 240 export const X_OFFSET = 60 export const NODE_WIDTH_X_OFFSET = NODE_WIDTH + X_OFFSET diff --git a/web/app/components/workflow/nodes/iteration/panel.tsx b/web/app/components/workflow/nodes/iteration/panel.tsx index 5aa2949fd0..56e407ca7a 100644 --- a/web/app/components/workflow/nodes/iteration/panel.tsx +++ b/web/app/components/workflow/nodes/iteration/panel.tsx @@ -8,6 +8,7 @@ import VarReferencePicker from '../_base/components/variable/var-reference-picke import Split from '../_base/components/split' import ResultPanel from '../../run/result-panel' import IterationResultPanel from '../../run/iteration-result-panel' +import { MAX_ITERATION_PARALLEL_NUM, MIN_ITERATION_PARALLEL_NUM } from '../../constants' import type { IterationNodeType } from './types' import useConfig from './use-config' import { ErrorHandleMode, InputVarType, type NodePanelProps } from '@/app/components/workflow/types' @@ -113,21 +114,24 @@ const Panel: FC> = ({ -
- {t(`${i18nPrefix}.MaxParallelismDesc`)}
}> -
- { changeParallelNums(Number(e.target.value)) }} /> - -
+ { + inputs.is_parallel && (
+ {t(`${i18nPrefix}.MaxParallelismDesc`)}
}> +
+ { changeParallelNums(Number(e.target.value)) }} /> + +
+ + + ) + } - -