diff options
Diffstat (limited to 'service/http/service.go')
-rw-r--r-- | service/http/service.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/service/http/service.go b/service/http/service.go index e8e8eb51..ad59f887 100644 --- a/service/http/service.go +++ b/service/http/service.go @@ -54,7 +54,9 @@ func (s *Service) Init(cfg *Config, r *rpc.Service, e env.Environment) (bool, er s.cfg = cfg s.env = e if r != nil { - r.Register(ID, &rpcServer{s}) + if err := r.Register(ID, &rpcServer{s}); err != nil { + return false, err + } } return true, nil @@ -65,18 +67,13 @@ func (s *Service) Serve() error { s.mu.Lock() if s.env != nil { - values, err := s.env.GetEnv() - if err != nil { - return err - } - - for k, v := range values { - s.cfg.Workers.SetEnv(k, v) + if err := s.env.Copy(s.cfg.Workers); err != nil { + return nil } - - s.cfg.Workers.SetEnv("RR_HTTP", "true") } + s.cfg.Workers.SetEnv("RR_HTTP", "true") + s.rr = roadrunner.NewServer(s.cfg.Workers) s.rr.Listen(s.throw) |