Remove types.ShutdownChannel and replace with chan struct{}

This commit is contained in:
Sean Chittenden
2016-05-27 03:47:49 -07:00
parent 57bb374236
commit 3d22c22bf5
3 changed files with 4 additions and 6 deletions

View File

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

View File

@@ -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),

View File

@@ -1,4 +1,3 @@
package types
type PeriodicCallback func()
type ShutdownChannel chan struct{}