Skip to content

Commit

Permalink
Do not reconnect in retry write function
Browse files Browse the repository at this point in the history
  • Loading branch information
boecklim committed Mar 21, 2024
1 parent 4733644 commit 0ceb6e0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,7 @@ func (p *Peer) writeRetry(msg wire.Message) error {
}

notifyAndReconnect := func(err error, nextTry time.Duration) {
p.logger.Error("Failed to write message", slog.String("next try", nextTry.String()), slog.String(errKey, err.Error()))

err = p.connect()
if err != nil {
p.logger.Error("Failed to reconnect", slog.String("next try", nextTry.String()), slog.String(errKey, err.Error()))
}
p.logger.Error("Failed to write message", slog.Duration("next try", nextTry), slog.String(errKey, err.Error()))
}

return backoff.RetryNotify(operation, policy, notifyAndReconnect)
Expand Down

0 comments on commit 0ceb6e0

Please sign in to comment.