Merge pull request 'update vm 0703' (#260) from master_wq_infer into master
Former-commit-id: 940176d8319c9c70e8b77de97911f0a834d06e6b
This commit is contained in:
commit
c60c2a819f
|
@ -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"},
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue