diff --git a/adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go b/adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go index c8a16483..a920ee6f 100644 --- a/adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go +++ b/adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go @@ -42,11 +42,12 @@ func InitCron(svc *svc.ServiceContext) { for index, _ := range infoList.HpcInfoList { for _, job := range listJob.Jobs { if job.Name == infoList.HpcInfoList[index].Name { - copier.CopyWithOption(infoList.HpcInfoList[index], job, copier.Option{Converters: tool.Converters}) + copier.CopyWithOption(&infoList.HpcInfoList[index], job, copier.Option{Converters: tool.Converters}) infoList.HpcInfoList[index].JobId = strconv.Itoa(int(job.JobId)) infoList.HpcInfoList[index].StartTime = time.Unix(job.StartTime, 0).String() infoList.HpcInfoList[index].RunningTime = int64(time.Now().Sub(time.Unix(job.StartTime, 0)).Seconds()) infoList.HpcInfoList[index].Status = enum.State(job.JobState).String() + infoList.HpcInfoList[index].Version = "slurm 2.6.9" } } } @@ -66,29 +67,12 @@ func submitJob(infoList *pcmcoreclient.InfoListResp, submitJobLogic *SubmitJobLo for index, _ := range infoList.HpcInfoList { if infoList.HpcInfoList[index].Status == "Saved" { submitReq := hpcTH.SubmitJobReq{ - Account: "root", + Account: infoList.HpcInfoList[index].Account, Name: infoList.HpcInfoList[index].Name, Script: infoList.HpcInfoList[index].CmdScript, UserId: 123, } jobResult, _ := submitJobLogic.SubmitJob(&submitReq) - // 任务失败 - if jobResult.SubmitResponseMsg[0].ErrorCode != 0 { - infoList.HpcInfoList[index].Status = "Failed" - infoList.HpcInfoList[index].ExitCode = jobResult.SubmitResponseMsg[0].ErrorCode - // 查询失败的任务信息同步到core端 - for index, _ := range infoList.HpcInfoList { - historyResult, err := historyListLogic.ListHistoryJob(&hpcTH.ListHistoryJobReq{}) - if err != nil { - return - } - for _, historyJob := range historyResult.HistoryJobs { - if infoList.HpcInfoList[index].JobId == string(historyJob.Jobid) { - tool.Convert(historyJob, infoList.HpcInfoList[index]) - } - } - } - } // 任务提交成功 infoList.HpcInfoList[index].Status = "Pending" infoList.HpcInfoList[index].JobId = strconv.Itoa(int(jobResult.SubmitResponseMsg[0].JobId))