Skip to content

Commit

Permalink
disable initial burst
Browse files Browse the repository at this point in the history
  • Loading branch information
kazeburo committed Nov 19, 2018
1 parent b660df1 commit 888fcfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions saboreader/saboreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ func (s *Reader) RefreshLimiter(ctx context.Context) error {
if locked > 0 {
bytesPerSec = float64(s.bw / locked)
}
//fmt.Fprintf(os.Stderr, "new limit %f\n", bytesPerSec)
// fmt.Fprintf(os.Stderr, "new limit %f\n", bytesPerSec)
limiter := rate.NewLimiter(rate.Limit(bytesPerSec), burstLimit)
limiter.AllowN(time.Now(), burstLimit) // spend initial burst
// limiter.AllowN(time.Now(), burstLimit) // spend initial burst
s.mu.Lock()
defer s.mu.Unlock()
s.limiter = limiter
Expand Down

0 comments on commit 888fcfa

Please sign in to comment.