diff --git a/api/client/types.go b/api/client/types.go index bf5c676d..c6f88854 100644 --- a/api/client/types.go +++ b/api/client/types.go @@ -6,8 +6,8 @@ import ( ) var StatusMapping = map[string][]string{ - "Running": {"RUNNING", "RUNNING", "CONFIGURING", "COMPLETING"}, - "Succeeded": {"COMPLETED"}, + "Running": {"RUNNING", "RUNNING", "CONFIGURING", "COMPLETING", "BUILD"}, + "Succeeded": {"COMPLETED", "ACTIVE"}, "Failed": {"FAILED", "TIMEOUT", "DEADLINE", "OUT_OF_MEMORY", "BOOT_FAIL", "CANCELLED"}, } diff --git a/api/internal/logic/core/pushtaskinfologic.go b/api/internal/logic/core/pushtaskinfologic.go index a989b01f..b9a61f7b 100644 --- a/api/internal/logic/core/pushtaskinfologic.go +++ b/api/internal/logic/core/pushtaskinfologic.go @@ -59,8 +59,8 @@ func (l *PushTaskInfoLogic) PushTaskInfo(req *clientCore.PushTaskInfoReq) (*clie } case 02: for _, vmInfo := range req.VmInfoList { - l.svcCtx.DbEngin.Exec("update task_vm set status = ?,start_time = ? where cluster_id = ? and task_id = ? and name = ?", - vmInfo.Status, vmInfo.StartTime, vmInfo.ClusterId, vmInfo.TaskId, vmInfo.Name) + l.svcCtx.DbEngin.Exec("update task_vm set status = ?,start_time = ?,server_id = ? where cluster_id = ? and task_id = ? and name = ?", + vmInfo.Status, vmInfo.StartTime, vmInfo.ServerId, vmInfo.ClusterId, vmInfo.TaskId, vmInfo.Name) noticeInfo := clientCore.NoticeInfo{ TaskId: vmInfo.TaskId, AdapterId: vmInfo.AdapterId, @@ -108,7 +108,7 @@ func (l *PushTaskInfoLogic) PushTaskInfo(req *clientCore.PushTaskInfoReq) (*clie func syncTask(gorm *gorm.DB, noticeInfo clientCore.NoticeInfo) { var allStatus string - tx := gorm.Raw("SELECT CONCAT_WS(',',GROUP_CONCAT(DISTINCT h.status) ,GROUP_CONCAT(DISTINCT a.status) ,GROUP_CONCAT(DISTINCT c.status))as status from task t left join task_hpc h on t.id = h.task_id left join task_cloud c on t.id = c.task_id left join task_vm v on t.id = v.task_id left join task_ai a on t.id = a.task_id where t.id = ?", noticeInfo.TaskId).Scan(&allStatus) + tx := gorm.Raw("SELECT CONCAT_WS(',',GROUP_CONCAT(DISTINCT h.status) ,GROUP_CONCAT(DISTINCT a.status) ,GROUP_CONCAT(DISTINCT c.status),GROUP_CONCAT(DISTINCT v.status))as status from task t left join task_hpc h on t.id = h.task_id left join task_cloud c on t.id = c.task_id left join task_vm v on t.id = v.task_id left join task_ai a on t.id = a.task_id where t.id = ?", noticeInfo.TaskId).Scan(&allStatus) if tx.Error != nil { logx.Error(tx.Error) }