Skip to content

Commit 0fb4af6

Browse files
committed
watch config file instead of dir (closes jpillora#170)
1 parent d8b404b commit 0fb4af6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

share/settings/users.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"io/ioutil"
8-
"path/filepath"
98
"regexp"
109
"sync"
1110

@@ -103,15 +102,11 @@ func (u *UserIndex) addWatchEvents() error {
103102
if err != nil {
104103
return err
105104
}
106-
configDir := filepath.Dir(u.configFile)
107-
if err := watcher.Add(configDir); err != nil {
105+
if err := watcher.Add(u.configFile); err != nil {
108106
return err
109107
}
110108
go func() {
111109
for e := range watcher.Events {
112-
if e.Name != u.configFile {
113-
continue
114-
}
115110
if e.Op&fsnotify.Write != fsnotify.Write {
116111
continue
117112
}

0 commit comments

Comments
 (0)