summaryrefslogtreecommitdiff
path: root/service/reload/service.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-02-21 16:16:52 +0300
committerValery Piashchynski <[email protected]>2020-02-21 16:16:52 +0300
commitb44167f66258712df47c21896961756f8be672df (patch)
treecb4109599df8b4cb59cd6705b78fdf484daa387a /service/reload/service.go
parenta835127776e5f4c12cce68fdbac8e43684b0ca6d (diff)
Fix issues during the testing
Diffstat (limited to 'service/reload/service.go')
-rw-r--r--service/reload/service.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/service/reload/service.go b/service/reload/service.go
index 461f9430..bb85e15d 100644
--- a/service/reload/service.go
+++ b/service/reload/service.go
@@ -24,10 +24,6 @@ func (s *Service) Init(cfg *Config, c service.Container) (bool, error) {
if !s.reloadConfig.Enabled {
return false, nil
}
- wd, err := os.Getwd()
- if err != nil {
- return false, err
- }
var configs []WatcherConfig
@@ -45,6 +41,10 @@ func (s *Service) Init(cfg *Config, c service.Container) (bool, error) {
if cfg.Services[serviceName].service == nil {
continue
}
+ ignored, err := ConvertIgnored(config.Ignore)
+ if err != nil {
+ return false, err
+ }
configs = append(configs, WatcherConfig{
serviceName: serviceName,
recursive: config.Recursive,
@@ -59,12 +59,13 @@ func (s *Service) Init(cfg *Config, c service.Container) (bool, error) {
return ErrorSkip
},
files: make(map[string]os.FileInfo),
- ignored: ConvertIgnored(wd, config.Ignore),
+ ignored: ignored,
filePatterns: append(config.Patterns, cfg.Patterns...),
})
}
- s.watcher, err = NewWatcher(wd, configs)
+ var err error
+ s.watcher, err = NewWatcher(configs)
if err != nil {
return false, err
}