mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-26 16:49:08 +02:00
[client] Fix staticcheck findings from the updated golangci-lint (#7266)
* Fix staticcheck findings reported by the updated golangci-lint * Skip the receive error log when the local context is done
This commit is contained in:
@@ -146,11 +146,14 @@ func (c *GRPCClient) Receive(ctx context.Context, interval time.Duration, msgHan
|
||||
|
||||
streamStart := time.Now()
|
||||
|
||||
if err := c.receive(stream, msgHandler); err != nil {
|
||||
// receive always returns a non-nil error once the stream breaks;
|
||||
// handleRetryableError decides between reconnecting and exiting
|
||||
// permanently on local context cancellation
|
||||
err = c.receive(stream, msgHandler)
|
||||
if !isContextDone(err) {
|
||||
log.Errorf("receive failed: %v", err)
|
||||
return c.handleRetryableError(err, streamStart, backOff)
|
||||
}
|
||||
return nil
|
||||
return c.handleRetryableError(err, streamStart, backOff)
|
||||
}
|
||||
|
||||
if err := backoff.Retry(operation, backOff); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user