mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Only log registering if not registered
This commit is contained in:
parent
adc24dfc51
commit
1adcb237d9
@ -230,7 +230,14 @@ func (s *rpcServer) Register() error {
|
||||
Endpoints: endpoints,
|
||||
}
|
||||
|
||||
log.Infof("Registering node: %s", node.Id)
|
||||
s.Lock()
|
||||
registered := s.registered
|
||||
s.Unlock()
|
||||
|
||||
if !registered {
|
||||
log.Infof("Registering node: %s", node.Id)
|
||||
}
|
||||
|
||||
// create registry options
|
||||
rOpts := []registry.RegisterOption{registry.RegisterTTL(config.RegisterTTL)}
|
||||
|
||||
@ -238,13 +245,14 @@ func (s *rpcServer) Register() error {
|
||||
return err
|
||||
}
|
||||
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
if s.registered {
|
||||
// already registered? don't need to register subscribers
|
||||
if registered {
|
||||
return nil
|
||||
}
|
||||
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
s.registered = true
|
||||
|
||||
for sb, _ := range s.subscribers {
|
||||
|
Loading…
Reference in New Issue
Block a user