mirror of
https://github.com/status-im/consul.git
synced 2025-01-18 09:41:32 +00:00
agent: Simplify the local state sync
This commit is contained in:
parent
dbbf60f8f8
commit
d7d30f5cf5
@ -216,16 +216,17 @@ 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()
|
||||||
l.logger.Printf("[ERR] agent: failed to sync remote state: %v", err)
|
if err == nil {
|
||||||
select {
|
break
|
||||||
case <-l.consulCh:
|
}
|
||||||
case <-time.After(aeScale(syncRetryIntv, len(l.iface.LANMembers()))):
|
l.logger.Printf("[ERR] agent: failed to sync remote state: %v", err)
|
||||||
case <-shutdownCh:
|
select {
|
||||||
return
|
case <-l.consulCh:
|
||||||
}
|
case <-time.After(aeScale(syncRetryIntv, len(l.iface.LANMembers()))):
|
||||||
|
case <-shutdownCh:
|
||||||
|
return
|
||||||
}
|
}
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force-trigger AE to pickup any changes
|
// Force-trigger AE to pickup any changes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user