Skip to content

Commit

Permalink
fix: delay concluding attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
metacertain committed Jun 7, 2021
1 parent 2c5f15b commit 984f107
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/pushsync/pushsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func (ps *PushSync) pushPeer(ctx context.Context, peer swarm.Address, ch swarm.C

streamer, err := ps.streamer.NewStream(ctx, peer, nil, protocolName, protocolVersion, streamName)
if err != nil {
return nil, true, fmt.Errorf("new stream for peer %s: %w", peer, err)
return nil, false, fmt.Errorf("new stream for peer %s: %w", peer, err)
}
defer streamer.Close()

Expand All @@ -440,7 +440,7 @@ func (ps *PushSync) pushPeer(ctx context.Context, peer swarm.Address, ch swarm.C
Stamp: stamp,
}); err != nil {
_ = streamer.Reset()
return nil, true, fmt.Errorf("chunk %s deliver to peer %s: %w", ch.Address(), peer, err)
return nil, false, fmt.Errorf("chunk %s deliver to peer %s: %w", ch.Address(), peer, err)
}

ps.metrics.TotalSent.Inc()
Expand Down

0 comments on commit 984f107

Please sign in to comment.