diff --git a/api/internal/logic/core/pushtaskinfologic.go b/api/internal/logic/core/pushtaskinfologic.go index dbc93f3a..df1635d0 100644 --- a/api/internal/logic/core/pushtaskinfologic.go +++ b/api/internal/logic/core/pushtaskinfologic.go @@ -35,12 +35,12 @@ func (l *PushTaskInfoLogic) PushTaskInfo(req *clientCore.PushTaskInfoReq) (*clie case 0: for _, cloudInfo := range req.CloudInfoList { var taskId uint - result := l.svcCtx.DbEngin.Table("task_cloud").Select("task_id").Where("cluster_name=? and adapter_id=? and kind=?", cloudInfo.ClusterName, cloudInfo.AdapterId, cloudInfo.Kind).Find(&taskId) + result := l.svcCtx.DbEngin.Table("task_cloud").Select("task_id").Where("task_id = ?", cloudInfo.TaskId).Find(&taskId) if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, errors.New("Record does not exist") } - l.svcCtx.DbEngin.Exec("update task_cloud set status = ?,start_time = ?,result = ? where cluster_name = ? and adapter_id = ?", - cloudInfo.Status, cloudInfo.StartTime, cloudInfo.Result, cloudInfo.ClusterName, cloudInfo.AdapterId) + l.svcCtx.DbEngin.Exec("update task_cloud set status = ?,start_time = ?,result = ? where task_id = ?", + cloudInfo.Status, cloudInfo.StartTime, cloudInfo.Result, cloudInfo.TaskId) syncTask(l.svcCtx.DbEngin, int64(taskId)) } case 2: