Commit 665e974e authored by duanjinfei's avatar duanjinfei

update connect nm count

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