diff --git a/command/agent/agent.go b/command/agent/agent.go index 2ddbba7e8..b5526e32a 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -66,15 +66,14 @@ func NewAgent(config *Config, logOutput io.Writer) (*Agent, error) { logOutput = os.Stderr } - shutdownCh := make(chan struct{}) a := &Agent{ config: config, logger: log.New(logOutput, "", log.LstdFlags), logOutput: logOutput, - shutdownCh: shutdownCh, + shutdownCh: make(chan struct{}), } - if err := a.setupConsulSyncer(shutdownCh); err != nil { + if err := a.setupConsulSyncer(); err != nil { return nil, fmt.Errorf("Failed to initialize Consul syncer task: %v", err) } if err := a.setupServer(); err != nil { @@ -656,9 +655,9 @@ func (a *Agent) Stats() map[string]map[string]string { // setupConsulSyncer creates the Consul tasks used by this Nomad Agent // (either Client or Server mode). -func (a *Agent) setupConsulSyncer(shutdownCh chan struct{}) error { +func (a *Agent) setupConsulSyncer() error { var err error - a.consulSyncer, err = consul.NewSyncer(a.config.Consul, shutdownCh, a.logger) + a.consulSyncer, err = consul.NewSyncer(a.config.Consul, a.shutdownCh, a.logger) if err != nil { return err }