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

Former-commit-id: 153446e456a61b354ff1aed88e41860d3883a38b
This commit is contained in:
jagger 2024-05-06 15:00:50 +08:00
parent ff7aae0a88
commit cbf44ff184
1 changed files with 3 additions and 3 deletions

View File

@ -35,12 +35,12 @@ func (l *PushTaskInfoLogic) PushTaskInfo(req *clientCore.PushTaskInfoReq) (*clie
case 0: case 0:
for _, cloudInfo := range req.CloudInfoList { for _, cloudInfo := range req.CloudInfoList {
var taskId uint 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) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return nil, errors.New("Record does not exist") 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 = ?", l.svcCtx.DbEngin.Exec("update task_cloud set status = ?,start_time = ?,result = ? where task_id = ?",
cloudInfo.Status, cloudInfo.StartTime, cloudInfo.Result, cloudInfo.ClusterName, cloudInfo.AdapterId) cloudInfo.Status, cloudInfo.StartTime, cloudInfo.Result, cloudInfo.TaskId)
syncTask(l.svcCtx.DbEngin, int64(taskId)) syncTask(l.svcCtx.DbEngin, int64(taskId))
} }
case 2: case 2: