diff options
author | Wolfy-J <[email protected]> | 2018-06-03 22:15:56 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-03 22:15:56 +0300 |
commit | 1856b93ac024988322dec1760286de75158ae02d (patch) | |
tree | f1a96ace8ed69ad86de270de68d312c81702749f | |
parent | ed2719f7d4fc4ccde61e3a5c104a49b7e9e9ea5f (diff) |
error handling
-rw-r--r-- | cmd/rr/.rr.yaml | 2 | ||||
-rw-r--r-- | http/server.go | 5 | ||||
-rw-r--r-- | http/service.go | 7 |
3 files changed, 3 insertions, 11 deletions
diff --git a/cmd/rr/.rr.yaml b/cmd/rr/.rr.yaml index 4cc54ae9..aaabe7c2 100644 --- a/cmd/rr/.rr.yaml +++ b/cmd/rr/.rr.yaml @@ -46,7 +46,7 @@ http: number: 1 # maximum jobs per worker, 0 - unlimited. - maxJobs: 0 + maxJobs: 1 # worker allocation timeouts. timeouts: diff --git a/http/server.go b/http/server.go index 22c6380a..db1f22ef 100644 --- a/http/server.go +++ b/http/server.go @@ -81,10 +81,7 @@ func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // sendError sends error func (srv *Server) sendError(w http.ResponseWriter, r *http.Request, err error) { - if _, job := err.(roadrunner.JobError); !job { - logrus.Error(err) - } - + logrus.Errorf("http: %s", err) w.WriteHeader(500) w.Write([]byte(err.Error())) } diff --git a/http/service.go b/http/service.go index f8e05f4d..5d45240b 100644 --- a/http/service.go +++ b/http/service.go @@ -50,18 +50,13 @@ func (s *Service) Serve() error { } defer term() + //todo: remove rr.Observe(func(event int, ctx interface{}) { switch event { case roadrunner.EventPoolError: logrus.Error(ctx) - case roadrunner.EventWorkerCreate: - logrus.Infof("%s - created", ctx) case roadrunner.EventWorkerError: logrus.Errorf("%s: %s", ctx.(roadrunner.WorkerError).Worker, ctx.(roadrunner.WorkerError).Error()) - case roadrunner.EventWorkerDestruct: - logrus.Warnf("%s - destructed", ctx) - case roadrunner.EventWorkerKill: - logrus.Warnf("%s - killed", ctx) } }) |