From dbd3eb01397d13a79a18ad93b7381f7c73298478 Mon Sep 17 00:00:00 2001 From: zhouqunjie <450705171@qq.com> Date: Thu, 27 Apr 2023 00:43:52 -0700 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=B2=B3=E5=AF=B9=E6=8E=A5=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adaptor/PCM-HPC/PCM-TH/rpc/etc/hpcth.yaml | 2 +- adaptor/PCM-HPC/PCM-TH/rpc/hpcth.go | 1 - adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go | 7 ++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adaptor/PCM-HPC/PCM-TH/rpc/etc/hpcth.yaml b/adaptor/PCM-HPC/PCM-TH/rpc/etc/hpcth.yaml index ea8db24d..7e5ce6c8 100644 --- a/adaptor/PCM-HPC/PCM-TH/rpc/etc/hpcth.yaml +++ b/adaptor/PCM-HPC/PCM-TH/rpc/etc/hpcth.yaml @@ -2,7 +2,7 @@ NacosConfig: DataId: pcm-th-rpc.yaml Group: DEFAULT_GROUP ServerConfigs: - - IpAddr: 10.101.15.7 + - IpAddr: 119.45.100.73 Port: 8848 ClientConfig: NamespaceId: test diff --git a/adaptor/PCM-HPC/PCM-TH/rpc/hpcth.go b/adaptor/PCM-HPC/PCM-TH/rpc/hpcth.go index 74d0959a..d9cc1666 100644 --- a/adaptor/PCM-HPC/PCM-TH/rpc/hpcth.go +++ b/adaptor/PCM-HPC/PCM-TH/rpc/hpcth.go @@ -21,7 +21,6 @@ var configFile = flag.String("f", "adaptor/PCM-HPC/PCM-TH/rpc/etc/hpcth.yaml", " func main() { - //-------------------- flag.Parse() var bootstrapConfig commonConfig.BootstrapConfig 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 678ce5e7..c966cb41 100644 --- a/adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go +++ b/adaptor/PCM-HPC/PCM-TH/rpc/internal/logic/cronlogic.go @@ -7,10 +7,12 @@ import ( "PCM/common/enum" "context" "github.com/zeromicro/go-zero/core/logx" + "strconv" "time" ) func InitCron(svc *svc.ServiceContext) { + svc.Cron.Start() submitJobLogic := NewSubmitJobLogic(context.Background(), svc) listLogic := NewListJobLogic(context.Background(), svc) svc.Cron.AddFunc("*/5 * * * * ?", func() { @@ -36,11 +38,10 @@ func InitCron(svc *svc.ServiceContext) { for index, _ := range infoList.HpcInfoList { for _, job := range listJob.Jobs { if job.Name == infoList.HpcInfoList[index].Name { - infoList.HpcInfoList[index].JobId = string(job.JobId) + infoList.HpcInfoList[index].JobId = strconv.Itoa(int(job.JobId)) infoList.HpcInfoList[index].StartTime = time.Unix(job.StartTime, 0).String() infoList.HpcInfoList[index].RunningTime = time.Now().Sub(time.Unix(job.StartTime, 0)).Milliseconds() infoList.HpcInfoList[index].Status = enum.State(job.JobState).String() - } } } @@ -63,7 +64,7 @@ func submitJob(infoList *pcmcoreclient.InfoListResp, submitJobLogic *SubmitJobLo } jobResult, _ := submitJobLogic.SubmitJob(&submitReq) infoList.HpcInfoList[index].Status = "Pending" - infoList.HpcInfoList[index].JobId = string(jobResult.SubmitResponseMsg[0].JobId) + infoList.HpcInfoList[index].JobId = strconv.Itoa(int(jobResult.SubmitResponseMsg[0].JobId)) } } }