Skip to content

Commit

Permalink
fixup! discovery: split gossiper announcement into sub batches
Browse files Browse the repository at this point in the history
  • Loading branch information
John Griffith committed May 19, 2019
1 parent 92f324d commit 4d7c975
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions discovery/gossiper.go
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"errors"
"fmt"
"math"
"runtime"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -897,9 +896,8 @@ func calculateSubBatchSize(totalDelay, subBatchDelay time.Duration,
return batchSize
}

ratio := float64(subBatchDelay) / float64(totalDelay)

subBatchSize := int(math.Ceil(float64(batchSize) * ratio))
subBatchSize := (int(batchSize)*int(subBatchDelay) + int(totalDelay) - 1) /
int(totalDelay)

if subBatchSize < minimumBatchSize {
return minimumBatchSize
Expand Down

0 comments on commit 4d7c975

Please sign in to comment.