jinzhu / configor

Golang Configuration tool that support YAML, JSON, TOML, Shell Environment
MIT License
1.75k stars 204 forks source link

use fsnotify instead of polling for autoreload #77

Open cyberhck opened 2 years ago

cyberhck commented 2 years ago

Describe the feature

configor should reload config when the file changes and not poll it every once in a while.

Motivation

Currently, it does polling, if I do it too aggressively it calls my function too often, if not, then my credentials are rotated, but I won't know about it.

A much nicer API would be to use fsnotify instead. It has good support and it only calls if the file has changed.

Related Issues

cyberhck commented 2 years ago

hey everyone, we're happy to send a PR IF you guys will review and accept.

cyberhck commented 2 years ago

@jinzhu is this project still maintained? Looks like there's literally a PR which solves this issue and there has been no comments from you.