From c4fc007630c42118ecd615092f2caaeb9dd8617f Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Thu, 15 Sep 2022 05:12:30 -0500 Subject: [PATCH] refactor(raft_hashicorp): `timeSpeep` -> `timeSleep` (#3694) Signed-off-by: Ryan Russell Signed-off-by: Ryan Russell --- weed/server/raft_hashicorp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/server/raft_hashicorp.go b/weed/server/raft_hashicorp.go index 636ba8c37..8f81924d1 100644 --- a/weed/server/raft_hashicorp.go +++ b/weed/server/raft_hashicorp.go @@ -154,9 +154,9 @@ func NewHashicorpRaftServer(option *RaftServerOption) (*RaftServer, error) { cfg := s.AddPeersConfiguration() // Need to get lock, in case all servers do this at the same time. peerIdx := getPeerIdx(s.serverAddr, s.peers) - timeSpeep := time.Duration(float64(c.LeaderLeaseTimeout) * (rand.Float64()*0.25 + 1) * float64(peerIdx)) - glog.V(0).Infof("Bootstrapping idx: %d sleep: %v new cluster: %+v", peerIdx, timeSpeep, cfg) - time.Sleep(timeSpeep) + timeSleep := time.Duration(float64(c.LeaderLeaseTimeout) * (rand.Float64()*0.25 + 1) * float64(peerIdx)) + glog.V(0).Infof("Bootstrapping idx: %d sleep: %v new cluster: %+v", peerIdx, timeSleep, cfg) + time.Sleep(timeSleep) f := s.RaftHashicorp.BootstrapCluster(cfg) if err := f.Error(); err != nil { return nil, fmt.Errorf("raft.Raft.BootstrapCluster: %v", err)