From f0c58d5fcbd6eff74fb6256107e8ef3e2f59f8ed Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 18 Nov 2016 10:09:22 -0800 Subject: [PATCH] Fix SyncNow --- command/agent/consul/syncer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/agent/consul/syncer.go b/command/agent/consul/syncer.go index 13d55f533..2824ee053 100644 --- a/command/agent/consul/syncer.go +++ b/command/agent/consul/syncer.go @@ -168,6 +168,7 @@ func NewSyncer(consulConfig *config.ConsulConfig, shutdownCh chan struct{}, logg checkGroups: make(map[ServiceDomain]map[ServiceKey][]*consul.AgentCheckRegistration), checkRunners: make(map[consulCheckID]*CheckRunner), periodicCallbacks: make(map[string]types.PeriodicCallback), + notifySyncCh: make(chan struct{}, 1), // default noop implementation of addrFinder addrFinder: func(string) (string, int) { return "", 0 }, } @@ -824,7 +825,7 @@ func (c *Syncer) Run() { c.consulAvailable = true } case <-c.notifySyncCh: - sync.Reset(syncInterval) + sync.Reset(0) case <-c.shutdownCh: c.Shutdown() case <-c.notifyShutdownCh: