summaryrefslogtreecommitdiff
path: root/cmd/rr
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/rr')
-rw-r--r--cmd/rr/cmd/root.go11
-rw-r--r--cmd/rr/main.go2
2 files changed, 12 insertions, 1 deletions
diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go
index 74506004..2e170307 100644
--- a/cmd/rr/cmd/root.go
+++ b/cmd/rr/cmd/root.go
@@ -25,10 +25,11 @@ import (
"github.com/spf13/cobra"
"github.com/spiral/roadrunner/cmd/util"
"github.com/spiral/roadrunner/service"
+ "github.com/spiral/roadrunner/service/watcher"
"os"
)
-// Service bus for all the commands.
+// Services bus for all the commands.
var (
cfgFile, workDir, logFormat string
override []string
@@ -106,6 +107,14 @@ func init() {
util.Printf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
os.Exit(1)
}
+
+ // global watcher config
+ wcv, _ := Container.Get(watcher.ID)
+ if wcv, ok := wcv.(*watcher.Service); ok {
+ wcv.AddListener(func(event int, ctx interface{}) {
+ util.LogEvent(Logger, event, ctx)
+ })
+ }
})
}
diff --git a/cmd/rr/main.go b/cmd/rr/main.go
index 54915957..dc2fbc20 100644
--- a/cmd/rr/main.go
+++ b/cmd/rr/main.go
@@ -24,6 +24,7 @@ package main
import (
rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/spiral/roadrunner/service/watcher"
// services (plugins)
"github.com/spiral/roadrunner/service/env"
@@ -40,6 +41,7 @@ func main() {
rr.Container.Register(rpc.ID, &rpc.Service{})
rr.Container.Register(http.ID, &http.Service{})
rr.Container.Register(static.ID, &static.Service{})
+ rr.Container.Register(watcher.ID, &watcher.Service{})
// you can register additional commands using cmd.CLI
rr.Execute()