diff --git a/.goreleaser.yml b/.goreleaser.yml index 83f0de449e..94303e6c0d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,8 +7,8 @@ env: before: hooks: - - go mod download - - GO111MODULE=on go install github.com/gobuffalo/packr/v2/packr2 + - "go mod download" + - "go install github.com/gobuffalo/packr/v2/packr2" - packr2 builds: diff --git a/rule/fetcher_default.go b/rule/fetcher_default.go index d03868ebc7..9965a96d1b 100644 --- a/rule/fetcher_default.go +++ b/rule/fetcher_default.go @@ -12,6 +12,7 @@ import ( "os" "path" "path/filepath" + "reflect" "strings" "sync" @@ -166,8 +167,12 @@ func (f *FetcherDefault) Watch(ctx context.Context) error { } func (f *FetcherDefault) watch(ctx context.Context, watcher *fsnotify.Watcher, events chan event) error { + var pc map[string]interface{} + viperx.AddWatcher(func(e fsnotify.Event) error { - if !viper.HasChanged(configuration.ViperKeyAccessRuleRepositories) { + if reflect.DeepEqual(pc, viper.Get(configuration.ViperKeyAccessRuleRepositories)) { + f.r.Logger(). + Debug("Not reloading access rule repositories because configuration value has not changed.") return nil }