| @@ -65,12 +65,15 @@ func GetCloudbrainTask(ctx *context.APIContext) { | |||||
| return | return | ||||
| } | } | ||||
| taskRoles := result.TaskRoles | |||||
| taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) | |||||
| job.Status = result.JobStatus.State | |||||
| if result.JobStatus.State != string(models.JobWaiting) && result.JobStatus.State != string(models.JobFailed) { | |||||
| taskRoles := result.TaskRoles | |||||
| taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) | |||||
| job.ContainerIp = taskRes.TaskStatuses[0].ContainerIP | |||||
| job.ContainerID = taskRes.TaskStatuses[0].ContainerID | |||||
| job.Status = taskRes.TaskStatuses[0].State | |||||
| job.ContainerIp = taskRes.TaskStatuses[0].ContainerIP | |||||
| job.ContainerID = taskRes.TaskStatuses[0].ContainerID | |||||
| job.Status = taskRes.TaskStatuses[0].State | |||||
| } | |||||
| if result.JobStatus.State != string(models.JobWaiting) { | if result.JobStatus.State != string(models.JobWaiting) { | ||||
| err = models.UpdateJob(job) | err = models.UpdateJob(job) | ||||
| @@ -491,7 +491,7 @@ | |||||
| console.log("---------",index,job) | console.log("---------",index,job) | ||||
| const jobID = job.dataset.jobid; | const jobID = job.dataset.jobid; | ||||
| const repoPath = job.dataset.repopath; | const repoPath = job.dataset.repopath; | ||||
| if (job.textContent.trim() == 'STOPPED') { | |||||
| if (job.textContent.trim() == 'STOPPED' || job.textContent.trim() == 'FAILED') { | |||||
| return | return | ||||
| } | } | ||||
| @@ -499,7 +499,6 @@ | |||||
| $.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}`, (data) => { | $.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}`, (data) => { | ||||
| const jobID = data.JobID | const jobID = data.JobID | ||||
| const status = data.JobStatus | const status = data.JobStatus | ||||
| console.log("status",status) | |||||
| if (status != job.textContent.trim()) { | if (status != job.textContent.trim()) { | ||||
| //$('#' + jobID).text(status) | //$('#' + jobID).text(status) | ||||
| //if (status == 'STOPPED') { | //if (status == 'STOPPED') { | ||||