summaryrefslogtreecommitdiff
path: root/cmd/rr
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-03 18:02:24 +0300
committerWolfy-J <[email protected]>2018-06-03 18:02:24 +0300
commit7877e54547d1f8ca3b3431c6e9aa3cbd80af1403 (patch)
tree0485b09f58c60faf8f6ec856440c040cf660854f /cmd/rr
parent3c3ce22b7f1620bbcb0f787b26f1b1db4487470b (diff)
polishing
Diffstat (limited to 'cmd/rr')
-rw-r--r--cmd/rr/cmd/root.go3
-rw-r--r--cmd/rr/http/reload.go10
-rw-r--r--cmd/rr/http/workers.go4
3 files changed, 10 insertions, 7 deletions
diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go
index e9351e75..d0cac5ef 100644
--- a/cmd/rr/cmd/root.go
+++ b/cmd/rr/cmd/root.go
@@ -21,7 +21,6 @@
package cmd
import (
- "fmt"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -49,7 +48,7 @@ var (
// This is called by main.main(). It only needs to happen once to the CLI.
func Execute() {
if err := CLI.Execute(); err != nil {
- fmt.Println(err)
+ logrus.Error(err)
os.Exit(1)
}
}
diff --git a/cmd/rr/http/reload.go b/cmd/rr/http/reload.go
index 89c0b74b..6cdba576 100644
--- a/cmd/rr/http/reload.go
+++ b/cmd/rr/http/reload.go
@@ -21,22 +21,24 @@
package http
import (
- "fmt"
"github.com/spf13/cobra"
rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/sirupsen/logrus"
)
func reloadHandler(cmd *cobra.Command, args []string) {
client, err := rr.Services.RCPClient()
if err != nil {
- panic(err) // todo: change
+ logrus.Error(err)
+ return
}
defer client.Close()
var r string
if err := client.Call("http.Reset", true, &r); err != nil {
- panic(err)
+ logrus.Error(err)
+ return
}
- fmt.Println(r)
+ logrus.Info("restarting http worker pool")
}
diff --git a/cmd/rr/http/workers.go b/cmd/rr/http/workers.go
index 19fc6df8..13e8d21c 100644
--- a/cmd/rr/http/workers.go
+++ b/cmd/rr/http/workers.go
@@ -27,12 +27,14 @@ import (
"github.com/spiral/roadrunner/http"
"os"
"strconv"
+ "github.com/sirupsen/logrus"
)
func workersHandler(cmd *cobra.Command, args []string) {
client, err := rr.Services.RCPClient()
if err != nil {
- panic(err) // todo: change
+ logrus.Error(err)
+ return
}
defer client.Close()