mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
Remove types.ShutdownChannel and replace with chan struct{}
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
package types
|
||||
|
||||
type PeriodicCallback func()
|
||||
type ShutdownChannel chan struct{}
|
||||
|
||||
Reference in New Issue
Block a user