diff options
author | Valery Piashchynski <[email protected]> | 2020-02-23 16:41:05 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-02-23 16:41:05 +0300 |
commit | 690bf10bb8600ca79050aede7cbe954fe1027173 (patch) | |
tree | db01792f8c46146b367ebc32fa4a167130ed28d1 | |
parent | cd494bf847713a984811c5b5d972c47fc6a58168 (diff) | |
parent | 82c1c48f39433d334ef332a8c49351156b841bf7 (diff) |
Merge branch 'file_watcher_module' of github.com:spiral/roadrunner into file_watcher_module
-rw-r--r-- | .rr.yaml | 18 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | service/reload/service.go | 4 |
3 files changed, 20 insertions, 4 deletions
@@ -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 @@ -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) |