|
|
|
@ -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 |
|
|
|
|