Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: text-generation run batch (#1945)

zxhlyha1285cbf158b
diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx
index 4de8981fccb..d51e861f57e 100644
--- a/web/app/components/share/text-generation/index.tsx
+++ b/web/app/components/share/text-generation/index.tsx
@@ -279,7 +279,7 @@ const TextGeneration: FC<IMainProps> = ({
}
})
setAllTaskList(allTaskList)
-
+ setCurrGroupNum(0)
setControlSend(Date.now())
// clear run once task status
setControlStopResponding(Date.now())
@@ -295,10 +295,7 @@ const TextGeneration: FC<IMainProps> = ({
// avoid add many task at the same time
if (needToAddNextGroupTask)
setCurrGroupNum(hadRunedTaskNum)
- // console.group()
- // console.log(`[#${taskId}]: ${isSuccess ? 'success' : 'fail'}.currGroupNum: ${getCurrGroupNum()}.hadRunedTaskNum: ${hadRunedTaskNum}, needToAddNextGroupTask: ${needToAddNextGroupTask}`)
- // console.log([...allTasklistLatest.filter(task => [TaskStatus.completed, TaskStatus.failed].includes(task.status)).map(item => item.id), taskId].sort((a: any, b: any) => a - b).join(','))
- // console.groupEnd()
+
const nextPendingTaskIds = needToAddNextGroupTask ? pendingTaskList.slice(0, GROUP_SIZE).map(item => item.id) : []
const newAllTaskList = allTasklistLatest.map((item) => {
if (item.id === taskId) {