diff options
author | Matt Joiner <anacrolix@gmail.com> | 2020-09-23 11:47:50 +1000 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2020-09-23 11:47:50 +1000 |
commit | e0a706da27a7cf612d68fe2469112b1ad2dd7aa0 (patch) | |
tree | 2eca0e161ab1814819a416e825c58d6c14f1dfd9 | |
parent | Copy circle CI config from anacrolix/dht (diff) | |
download | stm-e0a706da27a7cf612d68fe2469112b1ad2dd7aa0.tar.gz stm-e0a706da27a7cf612d68fe2469112b1ad2dd7aa0.tar.xz |
Sleep by default again, and don't bother sleeping for less than 100 microseconds
-rw-r--r-- | funcs.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)) } |