From e0a706da27a7cf612d68fe2469112b1ad2dd7aa0 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 23 Sep 2020 11:47:50 +1000 Subject: Sleep by default again, and don't bother sleeping for less than 100 microseconds --- funcs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'funcs.go') diff --git a/funcs.go b/funcs.go index 2e2ad26..b7a2c29 100644 --- a/funcs.go +++ b/funcs.go @@ -23,7 +23,7 @@ var ( const ( profileFailedCommits = false - sleepBetweenRetries = false + sleepBetweenRetries = true ) func init() { @@ -59,8 +59,8 @@ retry: shift = maxShift } ns := int64(1) << shift - ns = rand.Int63n(ns) - if ns > 0 { + d := time.Duration(rand.Int63n(ns)) + if d > 100*time.Microsecond { tx.updateWatchers() time.Sleep(time.Duration(ns)) } -- cgit v1.2.3