Browse Source

fix

Signed-off-by: jagger <cossjie@foxmail.com>

Former-commit-id: 153446e456
pull/134/head
jagger 2 years ago
parent
commit
cbf44ff184
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      api/internal/logic/core/pushtaskinfologic.go

+ 3
- 3
api/internal/logic/core/pushtaskinfologic.go View File

@@ -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:


Loading…
Cancel
Save