Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
workers can be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Jan 22, 2019
1 parent 9dcf337 commit 25e2182
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ func (s *Service) Init(c service.Config, l *logrus.Logger, r *rpc.Service, e env
return false, err
}

// configuring worker pools
s.execPool = make(chan Handler, s.cfg.Workers.Pool.NumWorkers)
for i := int64(0); i < s.cfg.Workers.Pool.NumWorkers; i++ {
s.execPool <- s.exec
}

if r != nil {
if err := r.Register(ID, &rpcServer{s}); err != nil {
return false, err
}
}

if s.cfg.Workers != nil {
// configuring worker pools
s.execPool = make(chan Handler, s.cfg.Workers.Pool.NumWorkers)
for i := int64(0); i < s.cfg.Workers.Pool.NumWorkers; i++ {
s.execPool <- s.exec
}

s.rr = roadrunner.NewServer(s.cfg.Workers)
}

Expand Down

0 comments on commit 25e2182

Please sign in to comment.