Commit 601afeec authored by duanjinfei's avatar duanjinfei

retry connect nm report taskId

parent de31e5bf
......@@ -78,6 +78,7 @@ func monitorModelInfo(dockerOp *operate.DockerOp) {
}
dockerOp.ModelsInfo = modelInfosResp
reportTaskIds = append(reportTaskIds, maxLong)
dockerOp.ReportTaskIds = reportTaskIds
dockerOp.ModelTaskIdIndexesChan <- reportTaskIds
ticker = time.NewTicker(time.Minute * 10)
}
......
......@@ -51,7 +51,7 @@ func StartMonitor() {
isSelect := false
for i := 0; i < len(nodeManagerArr); i++ {
// TODO: 需要对索引进行一定的规则判断,随机选择其中的nodeManager进行链接
if int64(connectNodeManagerCount) == conf.GetConfig().NodeManagerNum {
if connectNodeManagerCount == conf.GetConfig().NodeManagerNum {
log.Warn("Nothing available node manager..................................")
break
}
......@@ -106,6 +106,9 @@ func StartMonitor() {
if isSuccess {
log.Info("Connect node manager client success:", manager.Info.Endpoint)
managerClient.UpdateLastHeartTime(time.Now())
if len(dockerOp.ReportTaskIds) > 0 {
dockerOp.ModelTaskIdIndexesChan <- dockerOp.ReportTaskIds
}
continue
}
}
......
......@@ -29,6 +29,7 @@ type DockerOp struct {
SignApi map[string]string
ModelsInfo []*models.ModelInfo
ModelTaskIdIndexesChan chan []uint64
ReportTaskIds []uint64
}
func init() {
......@@ -51,6 +52,7 @@ func NewDockerOp() *DockerOp {
ModelsInfo: make([]*models.ModelInfo, 1000),
UsedExternalPort: make(map[int64]bool, 0),
ModelTaskIdIndexesChan: make(chan []uint64, 0),
ReportTaskIds: make([]uint64, 0),
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment