Rename client/consul/sync.PeriodicSync to Run

This commit is contained in:
Sean Chittenden 2016-05-23 07:24:00 -07:00
parent 768aab015d
commit b9789e0cf7
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
3 changed files with 5 additions and 5 deletions

View File

@ -351,10 +351,10 @@ func (c *Syncer) deregisterCheck(ID string) error {
return c.client.Agent().CheckDeregister(ID)
}
// PeriodicSync triggers periodic syncing of services and checks with Consul.
// This is a long lived go-routine which is stopped during shutdown
func (c *Syncer) PeriodicSync() {
sync := time.NewTicker(syncInterval)
// Run triggers periodic syncing of services and checks with Consul. This is
// a long lived go-routine which is stopped during shutdown.
func (c *Syncer) Run() {
for {
select {
case <-sync.C:

View File

@ -484,7 +484,7 @@ func (e *UniversalExecutor) SyncServices(ctx *ConsulContext) error {
e.interpolateServices(e.ctx.Task)
}
err := e.consulSyncer.SyncServices(e.ctx.Task.Services)
go e.consulSyncer.PeriodicSync()
go e.consulSyncer.Run()
return err
}

View File

@ -74,7 +74,7 @@ func NewAgent(config *Config, logOutput io.Writer) (*Agent, error) {
a.logger.Printf("[ERR] agent: unable to sync agent services with consul: %v", err)
}
if a.consulSyncer != nil {
go a.consulSyncer.PeriodicSync()
go a.consulSyncer.Run()
}
}