1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

fix watch func

This commit is contained in:
Tony 2019-05-09 23:06:15 +08:00
parent fa32988c6f
commit 618427fe84

View File

@ -74,7 +74,7 @@ func NewFile(base string) (Client, error) {
notify: notify,
watchers: make(map[*watcher]struct{}),
}
go f.watch(base)
go f.watchproc(base)
return f, nil
}
@ -111,7 +111,7 @@ func (f *file) Close() error {
}
// 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 {
log.Printf("paladin: create fsnotify for base path %s fail %s, reload function will lose efficacy", base, err)
return