summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-02-23 16:41:05 +0300
committerValery Piashchynski <[email protected]>2020-02-23 16:41:05 +0300
commit690bf10bb8600ca79050aede7cbe954fe1027173 (patch)
treedb01792f8c46146b367ebc32fa4a167130ed28d1
parentcd494bf847713a984811c5b5d972c47fc6a58168 (diff)
parent82c1c48f39433d334ef332a8c49351156b841bf7 (diff)
Merge branch 'file_watcher_module' of github.com:spiral/roadrunner into file_watcher_module
-rw-r--r--.rr.yaml18
-rw-r--r--go.mod2
-rw-r--r--service/reload/service.go4
3 files changed, 20 insertions, 4 deletions
diff --git a/.rr.yaml b/.rr.yaml
index 5792b881..daf1a4f1 100644
--- a/.rr.yaml
+++ b/.rr.yaml
@@ -159,4 +159,20 @@ static:
# health service configuration
health:
# http host to serve health requests.
- address: localhost:2113 \ No newline at end of file
+ address: localhost:2113
+
+reload:
+ # refresh internval (default 1s)
+ interval: 1s
+
+ # file extensions to watch, defaults to [.php]
+ patterns: [".php"]
+
+ # list of services to watch
+ services:
+ http:
+ # list of dirs, "" root
+ dirs: [""]
+
+ # include sub directories
+ recursive: true \ No newline at end of file
diff --git a/go.mod b/go.mod
index 57ffd209..8513085e 100644
--- a/go.mod
+++ b/go.mod
@@ -10,6 +10,8 @@ require (
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/olekukonko/tablewriter v0.0.4
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.4.1
diff --git a/service/reload/service.go b/service/reload/service.go
index f267375a..9c615e0b 100644
--- a/service/reload/service.go
+++ b/service/reload/service.go
@@ -104,8 +104,6 @@ func (s *Service) Serve() error {
go func() {
for e := range s.watcher.Event {
- s.log.Debugf("[UPDATE] Service: %s, path to file: %s, filename: %s", e.service, e.path, e.info.Name())
-
treshholdc <- struct {
serviceConfig ServiceConfig
service string
@@ -138,7 +136,7 @@ func (s *Service) Serve() error {
if err != nil {
s.log.Error(err)
}
- s.log.Debugf("found file changes in %s service, reloading", k)
+ s.log.Debugf("[%s] found %v file(s) changes, reloading", k, len(updated))
}
// zero map
updated = make(map[string]ServiceConfig, 100)