agent: Simplify the local state sync

This commit is contained in:
Armon Dadgar 2014-04-14 12:47:58 -07:00
parent dbbf60f8f8
commit d7d30f5cf5

View File

@ -216,7 +216,10 @@ func (l *localState) antiEntropy(shutdownCh chan struct{}) {
SYNC: SYNC:
// Sync our state with the servers // Sync our state with the servers
for { for {
if err := l.setSyncState(); err != nil { err := l.setSyncState()
if err == nil {
break
}
l.logger.Printf("[ERR] agent: failed to sync remote state: %v", err) l.logger.Printf("[ERR] agent: failed to sync remote state: %v", err)
select { select {
case <-l.consulCh: case <-l.consulCh:
@ -225,8 +228,6 @@ SYNC:
return return
} }
} }
break
}
// Force-trigger AE to pickup any changes // Force-trigger AE to pickup any changes
l.changeMade() l.changeMade()