mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 12:51:22 +00:00
fixes from bucky's review
This commit is contained in:
@ -254,10 +254,8 @@ func (c *WSClient) reconnect() error {
|
||||
c.mtx.Unlock()
|
||||
}()
|
||||
|
||||
// 1s == (1e9 ns) == (1 Billion ns)
|
||||
billionNs := float64(time.Second.Nanoseconds())
|
||||
for {
|
||||
jitterSeconds := time.Duration(rand.Float64() * billionNs)
|
||||
jitterSeconds := time.Duration(rand.Float64() * float64(time.Second)) // 1s == (1e9 ns)
|
||||
backoffDuration := jitterSeconds + ((1 << uint(attempt)) * time.Second)
|
||||
|
||||
c.Logger.Info("reconnecting", "attempt", attempt+1, "backoff_duration", backoffDuration)
|
||||
|
Reference in New Issue
Block a user