Skip to content

Commit

Permalink
fullrt: only log percentage completion of bulk sends if there are at …
Browse files Browse the repository at this point in the history
…least 100 messages to send
  • Loading branch information
aschmahmann committed May 27, 2021
1 parent eac1b5e commit 8cce656
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fullrt/dht.go
Expand Up @@ -978,7 +978,7 @@ func (dht *FullRT) bulkMessageSend(ctx context.Context, keys []peer.ID, fn func(
defer wg.Done()
for _, key := range chunk {
sendsSoFar := atomic.AddUint64(&numSends, 1)
if sendsSoFar%onePctKeys == 0 {
if onePctKeys > 0 && sendsSoFar%onePctKeys == 0 {
logger.Infof("bulk sending goroutine: %.1f%% done - %d/%d done", 100*float64(sendsSoFar)/float64(len(sortedKeys)), sendsSoFar, len(sortedKeys))
}
if err := fn(ctx, key); err != nil {
Expand Down

0 comments on commit 8cce656

Please sign in to comment.