Remove the shutdownCh as an argument, it was already present in the receiver
This commit is contained in:
parent
438c1e149b
commit
c2f96ee6ba
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue