fix watch func

pull/93/head
Tony 6 years ago
parent fa32988c6f
commit 618427fe84
  1. 4
      pkg/conf/paladin/file.go

@ -74,7 +74,7 @@ func NewFile(base string) (Client, error) {
notify: notify, notify: notify,
watchers: make(map[*watcher]struct{}), watchers: make(map[*watcher]struct{}),
} }
go f.watch(base) go f.watchproc(base)
return f, nil return f, nil
} }
@ -111,7 +111,7 @@ func (f *file) Close() error {
} }
// file config daemon to watch file modification // file config daemon to watch file modification
func (f *file) watch(base string) { func (f *file) watchproc(base string) {
if err := f.notify.Add(base); err != nil { if err := f.notify.Add(base); err != nil {
log.Printf("paladin: create fsnotify for base path %s fail %s, reload function will lose efficacy", base, err) log.Printf("paladin: create fsnotify for base path %s fail %s, reload function will lose efficacy", base, err)
return return

Loading…
Cancel
Save