summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/http/rpc.go12
-rw-r--r--service/http/rpc_test.go2
2 files changed, 1 insertions, 13 deletions
diff --git a/service/http/rpc.go b/service/http/rpc.go
index aebc5903..38aea2cf 100644
--- a/service/http/rpc.go
+++ b/service/http/rpc.go
@@ -1,9 +1,5 @@
package http
-import (
- "github.com/pkg/errors"
-)
-
type rpcServer struct{ svc *Service }
// WorkerList contains list of workers.
@@ -29,20 +25,12 @@ type Worker struct {
// Reset resets underlying RR worker pool and restarts all of it's workers.
func (rpc *rpcServer) Reset(reset bool, r *string) error {
- if rpc.svc.srv == nil {
- return errors.New("http server is not running")
- }
-
*r = "OK"
return rpc.svc.rr.Reset()
}
// Workers returns list of active workers and their stats.
func (rpc *rpcServer) Workers(list bool, r *WorkerList) error {
- if rpc.svc.srv == nil {
- return errors.New("http server is not running")
- }
-
for _, w := range rpc.svc.rr.Workers() {
state := w.State()
r.Workers = append(r.Workers, Worker{
diff --git a/service/http/rpc_test.go b/service/http/rpc_test.go
index ba71f7e1..f1c5786c 100644
--- a/service/http/rpc_test.go
+++ b/service/http/rpc_test.go
@@ -112,4 +112,4 @@ func Test_Workers(t *testing.T) {
assert.Len(t, r.Workers, 1)
assert.Equal(t, *ss.rr.Workers()[0].Pid, r.Workers[0].Pid)
-}
+} \ No newline at end of file