logtail/backoff: only log backoffs > 2sec

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
pull/342/head
David Crawshaw 5 years ago
parent 0038223632
commit 2372530964

@ -31,7 +31,9 @@ func (b *Backoff) BackOff(ctx context.Context, err error) {
// Randomize the delay between 0.5-1.5 x msec, in order
// to prevent accidental "thundering herd" problems.
msec = rand.Intn(msec) + msec/2
log.Printf("%s: backoff: %d msec\n", b.Name, msec)
if msec >= 2000 {
log.Printf("%s: backoff: %d msec\n", b.Name, msec)
}
newTimer := b.NewTimer
if newTimer == nil {
newTimer = time.NewTimer

Loading…
Cancel
Save