From 6a249ff23e2c72f342f4df67a4da89ba947e206a Mon Sep 17 00:00:00 2001 From: tzwang Date: Tue, 11 Mar 2025 15:36:51 +0800 Subject: [PATCH] update taskStatusSync --- etc/pcm.yaml | 2 +- internal/config/config.go | 2 +- internal/scheduler/schedulers/aiScheduler.go | 2 +- .../scheduler/service/utils/status/taskStatusSync.go | 11 ++++++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/etc/pcm.yaml b/etc/pcm.yaml index 90805d77..c92091af 100644 --- a/etc/pcm.yaml +++ b/etc/pcm.yaml @@ -84,4 +84,4 @@ BlockChain: Type: "2" JcsMiddleware: - Url: 101.201.215.196:7891 \ No newline at end of file + JobStatusReportUrl: 101.201.215.196:7891/jobSet/jobStatusReport \ No newline at end of file diff --git a/internal/config/config.go b/internal/config/config.go index 76131a02..64d525ea 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -65,5 +65,5 @@ type SnowflakeConf struct { } type JcsMiddleware struct { - Url string + JobStatusReportUrl string } diff --git a/internal/scheduler/schedulers/aiScheduler.go b/internal/scheduler/schedulers/aiScheduler.go index 8174f528..2589790b 100644 --- a/internal/scheduler/schedulers/aiScheduler.go +++ b/internal/scheduler/schedulers/aiScheduler.go @@ -320,7 +320,7 @@ func (as *AiScheduler) handleErrors(errs []interface{}, clusters []*strategy.Ass //report status if mode == executor.SUBMIT_MODE_STORAGE_SCHEDULE { - _ = jcs.StatusReport(as.AiService.Conf.JcsMiddleware.Url, report) + _ = jcs.StatusReport(as.AiService.Conf.JcsMiddleware.JobStatusReportUrl, report) } logx.Errorf(errors.New(errmsg).Error()) diff --git a/internal/scheduler/service/utils/status/taskStatusSync.go b/internal/scheduler/service/utils/status/taskStatusSync.go index e6c0f455..64f32bb8 100644 --- a/internal/scheduler/service/utils/status/taskStatusSync.go +++ b/internal/scheduler/service/utils/status/taskStatusSync.go @@ -60,12 +60,17 @@ func UpdateTaskStatus(svc *svc.ServiceContext, tasklist []*types.TaskModel) { } if len(aiTask) == 1 { - if aiTask[0].Status == constants.Completed { + switch aiTask[0].Status { + case constants.Completed: task.Status = constants.Succeeded _ = reportStatusMessages(svc, task, aiTask[0]) - } else { + case constants.Failed: + task.Status = constants.Failed + _ = reportStatusMessages(svc, task, aiTask[0]) + default: task.Status = aiTask[0].Status } + task.StartTime = aiTask[0].StartTime task.EndTime = aiTask[0].EndTime err := svc.Scheduler.AiStorages.UpdateTask(task) @@ -159,7 +164,7 @@ func reportStatusMessages(svc *svc.ServiceContext, task *types.TaskModel, aiTask } report.Messages = append(report.Messages, jobMsg) - _ = jcs.StatusReport(svc.Scheduler.AiService.Conf.JcsMiddleware.Url, report) + _ = jcs.StatusReport(svc.Scheduler.AiService.Conf.JcsMiddleware.JobStatusReportUrl, report) return nil }