summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-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()