Commit 665e974e authored by duanjinfei's avatar duanjinfei

update connect nm count

parent 0272cf84
......@@ -11,7 +11,6 @@ import (
)
func monitorNodeManagerSeed() {
connectNmCumulativeCount := 0
ticker := time.NewTicker(time.Second * 1)
for {
select {
......@@ -20,22 +19,12 @@ func monitorNodeManagerSeed() {
log.Info("Nm seed url:", seed)
seedServiceClient := operate.ConnNmGrpc(seed)
if seedServiceClient == nil {
if connectNmCumulativeCount == conf.GetConfig().AllowConnNmCount {
log.Error("Dial nm seed service client failed")
continue
}
log.Warn("Connect nm seed service client is nil")
connectNmCumulativeCount++
continue
}
list, err := seedServiceClient.ManagerList(context.Background(), &nodeManagerV1.ManagerListRequest{}, grpc.EmptyCallOption{})
if err != nil {
if connectNmCumulativeCount == conf.GetConfig().AllowConnNmCount {
log.Error("Nm seed seed service is dealing")
continue
}
log.WithError(err).Warn("Get manager list failed through nm seed service")
connectNmCumulativeCount++
continue
}
if list.GetManagers() == nil || len(list.GetManagers()) == 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