Fix invalid register check err in log (#1801)
* remove global error tracking * rpc_server: fix invalid register err Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
parent
0ed1c70d29
commit
b37f9c94b8
@ -898,7 +898,7 @@ func (s *rpcServer) Start() error {
|
|||||||
rerr := s.opts.RegisterCheck(s.opts.Context)
|
rerr := s.opts.RegisterCheck(s.opts.Context)
|
||||||
if rerr != nil && registered {
|
if rerr != nil && registered {
|
||||||
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
|
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
|
||||||
log.Errorf("Server %s-%s register check error: %s, deregister it", config.Name, config.Id, err)
|
log.Errorf("Server %s-%s register check error: %s, deregister it", config.Name, config.Id, rerr)
|
||||||
}
|
}
|
||||||
// deregister self in case of error
|
// deregister self in case of error
|
||||||
if err := s.Deregister(); err != nil {
|
if err := s.Deregister(); err != nil {
|
||||||
@ -908,7 +908,7 @@ func (s *rpcServer) Start() error {
|
|||||||
}
|
}
|
||||||
} else if rerr != nil && !registered {
|
} else if rerr != nil && !registered {
|
||||||
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
|
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
|
||||||
log.Errorf("Server %s-%s register check error: %s", config.Name, config.Id, err)
|
log.Errorf("Server %s-%s register check error: %s", config.Name, config.Id, rerr)
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user