Skip to content

Commit

Permalink
Add documentation to error handling with isRetry
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Oct 11, 2024
1 parent c603799 commit ad9d559
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
// over libp2p grpc connection
func (s *server) pushLog(evt event.Update, pid peer.ID) (err error) {
defer func() {
// When the event is a retry, we don't need to republish the failure as
// it is already being handled by the retry mechanism through the success channel.
if err != nil && !evt.IsRetry {
s.peer.bus.Publish(event.NewMessage(event.ReplicatorFailureName, event.ReplicatorFailure{
DocID: evt.DocID,
Expand Down

0 comments on commit ad9d559

Please sign in to comment.