How to stop file watcher?
couldn't find a way to stop file-watching.
f := file.Provider("somefile.yaml"))
f.Watch(func(event any, e error) error {
// handler
}
am I missing something?
You're right, there's no way to currently stop watching files. Please feel free to send a PR. Perhaps an f.Unwatch().
not sure if I have enough spare time in the near future. but if I implemented this feature, I would update the Provider interface by adding
Watch(func(...) error) error // returns error if doesn't support
Unwatch() error // same here
methods to make it more unified
Hi @knadh , If this issue is still open would you mind taking a look at my PR https://github.com/knadh/koanf/pull/245. I have tried implementing the unwatch function for file provider. let me know if you feel any changes are to be made...