summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/container.go1
-rw-r--r--service/http/rpc.go7
-rw-r--r--service/http/service.go8
3 files changed, 6 insertions, 10 deletions
diff --git a/service/container.go b/service/container.go
index 1233b30d..56350be7 100644
--- a/service/container.go
+++ b/service/container.go
@@ -140,6 +140,7 @@ func (c *container) Serve() error {
defer e.setStatus(StatusStopped)
if err := e.svc.Serve(); err != nil {
+ c.log.Errorf("[%s]: %s", e.name, err)
done <- errors.Wrap(err, fmt.Sprintf("[%s]", e.name))
}
}(e)
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)
}