diff options
author | Wolfy-J <[email protected]> | 2018-09-29 23:37:16 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2018-09-29 23:37:16 +0300 |
commit | 6122fca108c20984732c969fb1ba53cce5b3c44a (patch) | |
tree | 40835f46a5c208ea2546b76e3bd9fa05429b405a /cmd/rr/http/reset.go | |
parent | abe62c0675f839586312cff1c83d6a4cb31dd9d5 (diff) | |
parent | a04b5b33eb30944007973067ec07e9c4a2c464ab (diff) |
Merge pull request #39 from spiral/feature/1.3.0v1.2.3
Feature/1.3.0
Diffstat (limited to 'cmd/rr/http/reset.go')
-rw-r--r-- | cmd/rr/http/reset.go | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/cmd/rr/http/reset.go b/cmd/rr/http/reset.go index 3bc089ec..42fd966d 100644 --- a/cmd/rr/http/reset.go +++ b/cmd/rr/http/reset.go @@ -21,41 +21,33 @@ package http import ( - "errors" "github.com/spf13/cobra" rr "github.com/spiral/roadrunner/cmd/rr/cmd" - "github.com/spiral/roadrunner/cmd/rr/utils" - "github.com/spiral/roadrunner/service" - "github.com/spiral/roadrunner/service/rpc" + "github.com/spiral/roadrunner/cmd/util" ) func init() { rr.CLI.AddCommand(&cobra.Command{ Use: "http:reset", - Short: "Reload RoadRunner worker pools for the HTTP service", + Short: "Reload RoadRunner worker pool for the HTTP service", RunE: reloadHandler, }) } func reloadHandler(cmd *cobra.Command, args []string) error { - svc, st := rr.Container.Get(rpc.ID) - if st < service.StatusOK { - return errors.New("RPC service is not configured") - } - - client, err := svc.(*rpc.Service).Client() + client, err := util.RPCClient(rr.Container) if err != nil { return err } defer client.Close() - utils.Printf("<green>restarting http worker pool</reset>: ") + util.Printf("<green>restarting http worker pool</reset>: ") var r string if err := client.Call("http.Reset", true, &r); err != nil { return err } - utils.Printf("<green+hb>done</reset>\n") + util.Printf("<green+hb>done</reset>\n") return nil } |