summaryrefslogtreecommitdiff
path: root/service/reload/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/reload/service.go')
-rw-r--r--service/reload/service.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/service/reload/service.go b/service/reload/service.go
index 12b157ab..461f9430 100644
--- a/service/reload/service.go
+++ b/service/reload/service.go
@@ -60,7 +60,7 @@ func (s *Service) Init(cfg *Config, c service.Container) (bool, error) {
},
files: make(map[string]os.FileInfo),
ignored: ConvertIgnored(wd, config.Ignore),
- filePatterns: config.Patterns,
+ filePatterns: append(config.Patterns, cfg.Patterns...),
})
}
@@ -76,6 +76,11 @@ func (s *Service) Serve() error {
if !s.reloadConfig.Enabled {
return nil
}
+
+ if s.reloadConfig.Interval < time.Second {
+ return errors.New("reload interval is too fast")
+ }
+
go func() {
for {
select {
@@ -99,10 +104,6 @@ func (s *Service) Serve() error {
}
}()
- if s.reloadConfig.Interval < time.Second {
- return errors.New("too fast")
- }
-
err := s.watcher.StartPolling(s.reloadConfig.Interval)
if err != nil {
return err