Merge pull request 'fix aitasklist bugs' (#177) from tzwang/pcm-coordinator:master into master

Former-commit-id: e174a7654e0328eeb354e4da3e797abdc20eb6fe
This commit is contained in:
tzwang 2024-05-16 11:24:40 +08:00
commit 7101925e9c
2 changed files with 4 additions and 5 deletions

View File

@ -101,7 +101,7 @@ func (l *GetCenterTaskListLogic) updateAiTaskStatus(mu *sync.RWMutex, ch chan<-
} }
for _, task := range taskList { for _, task := range taskList {
t := task t := task
if t.Status == constants.Completed { if t.Status == constants.Completed || task.Status == constants.Failed {
continue continue
} }
wg.Add(1) wg.Add(1)

View File

@ -80,8 +80,7 @@ func (l *PageListTaskLogic) PageListTask(req *types.PageTaskReq) (resp *types.Pa
for _, ch := range chs { for _, ch := range chs {
select { select {
case <-ch: case <-ch:
return case <-time.After(2 * time.Second):
case <-time.After(1 * time.Second):
return return
} }
} }
@ -93,7 +92,7 @@ func (l *PageListTaskLogic) updateTaskStatus(tasks []*types.TaskModel, ch chan<-
if task.AdapterTypeDict != 1 { if task.AdapterTypeDict != 1 {
continue continue
} }
if task.Status == constants.Succeeded { if task.Status == constants.Succeeded || task.Status == constants.Failed {
continue continue
} }
@ -171,7 +170,7 @@ func (l *PageListTaskLogic) updateAiTaskStatus(tasks []*types.TaskModel, ch chan
if task.AdapterTypeDict != 1 { if task.AdapterTypeDict != 1 {
continue continue
} }
if task.Status == constants.Succeeded { if task.Status == constants.Succeeded || task.Status == constants.Failed {
continue continue
} }