Skip to content

Commit

Permalink
Fix broken reload tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 17, 2019
1 parent 3521a3d commit d6059b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion rule/fetcher_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"path"
"path/filepath"
"reflect"
"strings"
"sync"

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit d6059b7

Please sign in to comment.