nomad: track the workers in the pool

This commit is contained in:
Armon Dadgar 2015-08-23 10:53:53 -07:00
parent 8c2bc337e6
commit d4e2faf216
1 changed files with 6 additions and 1 deletions

View File

@ -115,6 +115,9 @@ type Server struct {
heartbeatTimers map[string]*time.Timer
heartbeatTimersLock sync.Mutex
// Worker used for processing
workers []*Worker
left bool
shutdown bool
shutdownCh chan struct{}
@ -528,8 +531,10 @@ func (s *Server) setupWorkers() error {
// Start the workers
for i := 0; i < s.config.NumSchedulers; i++ {
if _, err := NewWorker(s); err != nil {
if w, err := NewWorker(s); err != nil {
return err
} else {
s.workers = append(s.workers, w)
}
}
s.logger.Printf("[INFO] nomad: starting %d scheduling worker(s) for %v",