Merge pull request #1136 from aledbf/revert-status

Fix status update - changed in #1074
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-08-15 19:00:02 -03:00 committed by GitHub
commit 81a36b4bee

View file

@ -92,10 +92,16 @@ type statusSync struct {
// Run starts the loop to keep the status in sync
func (s statusSync) Run(stopCh <-chan struct{}) {
go wait.Forever(s.elector.Run, 0)
go wait.Forever(s.update, updateInterval)
go s.syncQueue.Run(time.Second, stopCh)
<-stopCh
}
func (s *statusSync) update() {
// send a dummy object to the queue to force a sync
s.syncQueue.Enqueue("sync status")
}
// Shutdown stop the sync. In case the instance is the leader it will remove the current IP
// if there is no other instances running.
func (s statusSync) Shutdown() {