summaryrefslogtreecommitdiff
path: root/service/http
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-01-05 12:21:37 +0300
committerWolfy-J <[email protected]>2019-01-05 12:21:37 +0300
commit46009112a783a1fdae95e0a061d4c8c41a1c8ff1 (patch)
treea34cf8ad465e9f354723f855c531ea1db3235cbd /service/http
parentd5e5be00aca87ea39ece9c04efe7dc354b1dc3f6 (diff)
first set of patches
Diffstat (limited to 'service/http')
-rw-r--r--service/http/service.go17
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)