summaryrefslogtreecommitdiff
path: root/plugins/reload
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-03-28 14:00:54 +0300
committerValery Piashchynski <[email protected]>2021-03-28 14:00:54 +0300
commit2a58b1be2c79f2fe10c0a429878937661645a928 (patch)
treef3a7cd472c75c4dd2a97bcf97cb154731ed81230 /plugins/reload
parent970014530a23d57a3be41c6369ac6456d0b36ae1 (diff)
- Fix bug with the worker reallocating during the response
- Update .golangci and fix new warnings Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/reload')
-rw-r--r--plugins/reload/plugin.go6
-rw-r--r--plugins/reload/watcher.go1
2 files changed, 3 insertions, 4 deletions
diff --git a/plugins/reload/plugin.go b/plugins/reload/plugin.go
index d76fb0a4..bf88462e 100644
--- a/plugins/reload/plugin.go
+++ b/plugins/reload/plugin.go
@@ -44,11 +44,11 @@ func (s *Plugin) Init(cfg config.Configurer, log logger.Logger, res resetter.Res
s.stopc = make(chan struct{}, 1)
s.services = make(map[string]interface{})
- var configs []WatcherConfig
+ configs := make([]WatcherConfig, 0, len(s.cfg.Services))
for serviceName, serviceConfig := range s.cfg.Services {
- ignored, err := ConvertIgnored(serviceConfig.Ignore)
- if err != nil {
+ ignored, errIgn := ConvertIgnored(serviceConfig.Ignore)
+ if errIgn != nil {
return errors.E(op, err)
}
configs = append(configs, WatcherConfig{
diff --git a/plugins/reload/watcher.go b/plugins/reload/watcher.go
index 8dde38de..1b3407e5 100644
--- a/plugins/reload/watcher.go
+++ b/plugins/reload/watcher.go
@@ -148,7 +148,6 @@ func ConvertIgnored(ignored []string) (map[string]struct{}, error) {
// pass map from outside
func (w *Watcher) retrieveFilesSingle(serviceName, path string) (map[string]os.FileInfo, error) {
- const op = errors.Op("watcher_retrieve_files_single")
stat, err := os.Stat(path)
if err != nil {
return nil, err