From ba2603904371a26269514089e7c6657d4dc2e053 Mon Sep 17 00:00:00 2001 From: tzwang Date: Tue, 21 May 2024 15:11:54 +0800 Subject: [PATCH] fix tasklist bugs Former-commit-id: a37be139ca44f8eb0fb8a6a32420f14b324615fc --- api/internal/logic/core/pagelisttasklogic.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/internal/logic/core/pagelisttasklogic.go b/api/internal/logic/core/pagelisttasklogic.go index d680bb09..e41e7474 100644 --- a/api/internal/logic/core/pagelisttasklogic.go +++ b/api/internal/logic/core/pagelisttasklogic.go @@ -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 }