Remove the shutdownCh as an argument, it was already present in the receiver

This commit is contained in:
Sean Chittenden 2016-06-16 23:15:41 -07:00
parent 438c1e149b
commit c2f96ee6ba
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
1 changed files with 4 additions and 5 deletions

View File

@ -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
}