Fix review comment.

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent 3af8a96cb3
commit a1cda807a4
  1. 10
      consensus/consensus_v2.go

@ -310,9 +310,7 @@ func (consensus *Consensus) Start(
case <-stopChan:
return
case <-ticker.C:
consensus.mutex.Lock()
consensus.tick()
consensus.mutex.Unlock()
consensus.Tick()
}
}
}()
@ -373,6 +371,12 @@ func (consensus *Consensus) syncNotReadyChan() {
consensusSyncCounterVec.With(prometheus.Labels{"consensus": "out_of_sync"}).Inc()
}
func (consensus *Consensus) Tick() {
consensus.mutex.Lock()
defer consensus.mutex.Unlock()
consensus.tick()
}
func (consensus *Consensus) tick() {
if !consensus.start && consensus.isInitialLeader {
return

Loading…
Cancel
Save