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

Former-commit-id: 8557465fcf138a11f8f3c9184cee880835e723dc
This commit is contained in:
tzwang 2024-05-21 15:16:12 +08:00
commit c489fad8e9
1 changed files with 12 additions and 0 deletions

View File

@ -117,6 +117,11 @@ func (l *PageListTaskLogic) updateTaskStatus(tasklist []*types.TaskModel, ch cha
}
if len(aiTask) == 0 {
tx = l.svcCtx.DbEngin.Model(task).Table("task").Where("deleted_at is null").Updates(task)
if tx.Error != nil {
logx.Errorf(tx.Error.Error())
return
}
ch <- struct{}{}
return
}
@ -146,6 +151,13 @@ func (l *PageListTaskLogic) updateTaskStatus(tasklist []*types.TaskModel, ch cha
}
if len(aiTask) == 0 {
task.UpdatedTime = time.Now().Format(constants.Layout)
tx = l.svcCtx.DbEngin.Table("task").Model(task).Updates(task)
if tx.Error != nil {
logx.Errorf(tx.Error.Error())
ch <- struct{}{}
return
}
ch <- struct{}{}
return
}