Commit ec8cab68 authored by masala's avatar masala

sync bootstrap to 30s boundaries

parent 7912b83d
...@@ -201,7 +201,9 @@ func (s *state) fsm() <-chan time.Time { ...@@ -201,7 +201,9 @@ func (s *state) fsm() <-chan time.Time {
} }
s.pruneDocuments() s.pruneDocuments()
if s.votingEpoch <= epoch || sleep < 0 { if s.votingEpoch <= epoch || sleep < 0 {
sleep = 30 * time.Second sec := time.Now().Second()
// sleep up to a 30 second increment
sleep = time.Duration(30 - (sec % 30)) * time.Second
} }
s.log.Debugf("authority: FSM in state %v until %s", s.state, sleep) s.log.Debugf("authority: FSM in state %v until %s", s.state, sleep)
s.Unlock() s.Unlock()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment