diff --git a/client/consul/sync.go b/client/consul/sync.go index db3d64695..dd8d4b34b 100644 --- a/client/consul/sync.go +++ b/client/consul/sync.go @@ -39,7 +39,7 @@ type Syncer struct { logger *log.Logger - shutdownCh types.ShutdownChannel + shutdownCh chan struct{} shutdown bool shutdownLock sync.Mutex @@ -135,7 +135,7 @@ func NewSyncer(config *config.ConsulConfig, logger *log.Logger) (*Syncer, error) trackedServices: make(map[string]*consul.AgentService), trackedChecks: make(map[string]*consul.AgentCheckRegistration), checkRunners: make(map[string]*CheckRunner), - shutdownCh: make(types.ShutdownChannel), + shutdownCh: make(chan struct{}), periodicCallbacks: make(map[string]types.PeriodicCallback), } return &consulSyncer, nil diff --git a/command/agent/agent.go b/command/agent/agent.go index 60361bfd0..f92ec4abd 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -18,7 +18,6 @@ import ( "github.com/hashicorp/nomad/nomad" "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/nomad/structs/config" - "github.com/hashicorp/nomad/nomad/types" ) // Agent is a long running daemon that is used to run both @@ -47,7 +46,7 @@ type Agent struct { serverRpcAddr string shutdown bool - shutdownCh types.ShutdownChannel + shutdownCh chan struct{} shutdownLock sync.Mutex } @@ -58,7 +57,7 @@ func NewAgent(config *Config, logOutput io.Writer) (*Agent, error) { logOutput = os.Stderr } - shutdownCh := make(types.ShutdownChannel) + shutdownCh := make(chan struct{}) a := &Agent{ config: config, logger: log.New(logOutput, "", log.LstdFlags), diff --git a/nomad/types/types.go b/nomad/types/types.go index bb4ca5525..37196ac39 100644 --- a/nomad/types/types.go +++ b/nomad/types/types.go @@ -1,4 +1,3 @@ package types type PeriodicCallback func() -type ShutdownChannel chan struct{}