Rename client/consul/sync.PeriodicSync to Run
This commit is contained in:
parent
768aab015d
commit
b9789e0cf7
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue