diff options
Diffstat (limited to 'service/http')
-rw-r--r-- | service/http/rpc.go | 7 | ||||
-rw-r--r-- | service/http/service.go | 8 |
2 files changed, 5 insertions, 10 deletions
diff --git a/service/http/rpc.go b/service/http/rpc.go index fc6aa65b..aebc5903 100644 --- a/service/http/rpc.go +++ b/service/http/rpc.go @@ -34,12 +34,7 @@ func (rpc *rpcServer) Reset(reset bool, r *string) error { } *r = "OK" - - for _, w := range rpc.svc.rr.Workers() { - w.Kill() - } - - return nil //rpc.svc.rr.Reset() + return rpc.svc.rr.Reset() } // Workers returns list of active workers and their stats. diff --git a/service/http/service.go b/service/http/service.go index a3773468..dc89c188 100644 --- a/service/http/service.go +++ b/service/http/service.go @@ -19,9 +19,9 @@ type middleware interface { // Service manages rr, http servers. type Service struct { cfg *Config - listeners []func(event int, ctx interface{}) - middleware []middleware + lsns []func(event int, ctx interface{}) rr *roadrunner.Server + middleware []middleware srv *Handler http *http.Server } @@ -32,7 +32,7 @@ func (s *Service) AddMiddleware(m middleware) { // AddListener attaches server event watcher. func (s *Service) AddListener(l func(event int, ctx interface{})) { - s.listeners = append(s.listeners, l) + s.lsns = append(s.lsns, l) } // Configure must return configure svc and return true if svc hasStatus enabled. Must return error in case of @@ -113,7 +113,7 @@ func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func (s *Service) listener(event int, ctx interface{}) { - for _, l := range s.listeners { + for _, l := range s.lsns { l(event, ctx) } |