mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-31 15:31:20 +00:00
rpc: Better connection handling (#10714)
This commit is contained in:
parent
0d2696ed4e
commit
ee6aa4d4ec
@ -70,7 +70,9 @@ func (s *Service) pollConnectionStatus(ctx context.Context) {
|
||||
continue
|
||||
}
|
||||
// Close previous client, if connection was successful.
|
||||
currClient.Close()
|
||||
if currClient != nil {
|
||||
currClient.Close()
|
||||
}
|
||||
log.Infof("Connected to new endpoint: %s", logs.MaskCredentialsLogging(s.cfg.currHttpEndpoint.Url))
|
||||
return
|
||||
case <-s.ctx.Done():
|
||||
@ -92,7 +94,9 @@ func (s *Service) retryExecutionClientConnection(ctx context.Context, err error)
|
||||
return
|
||||
}
|
||||
// Close previous client, if connection was successful.
|
||||
currClient.Close()
|
||||
if currClient != nil {
|
||||
currClient.Close()
|
||||
}
|
||||
// Reset run error in the event of a successful connection.
|
||||
s.runError = nil
|
||||
}
|
||||
@ -114,7 +118,9 @@ func (s *Service) checkDefaultEndpoint(ctx context.Context) {
|
||||
return
|
||||
}
|
||||
// Close previous client, if connection was successful.
|
||||
currClient.Close()
|
||||
if currClient != nil {
|
||||
currClient.Close()
|
||||
}
|
||||
s.updateCurrHttpEndpoint(primaryEndpoint)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user