天河对接完成
This commit is contained in:
parent
7c1d1372e6
commit
dbd3eb0139
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue