-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add file change watch #534
base: master
Are you sure you want to change the base?
Conversation
zjj seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
registry/file/backend.go
Outdated
routes, err := ioutil.ReadFile(cfg.RoutesPath) | ||
if err != nil { | ||
log.Println("[ERROR] Cannot read routes from ", cfg.RoutesPath) | ||
b := &be{cfg: cfg, Interval: 2 * time.Second} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the Interval
configurable? See https://github.com/fabiolb/fabio/blob/master/config/load.go#L161 for an example.
Please also update the website documentation at
https://github.com/fabiolb/fabio/tree/master/docs/content/ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update to commited.
registry/file/backend.go
Outdated
return b, nil | ||
} | ||
|
||
func (b *be) readRoute() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you merge the two readXXX
functions into one like this
func readFile(path string, mtime time.Time) (string, error) {...}
already updated |
@1941198 any chance you can rebase against latest changes? @magiconair or @nathanejohnson what would it take to get this merged? |
This looks fairly clean and the original change points all seem to have been made. Is there anyone using this backend that can confirm operation? Are you currently using this backend @scalp42? |
@leprechau we're not using this in production, we're currently running #811 that allows turning off the consistent reads. |
I'm also looking forward to seeing this push through - @1941198 could you update the branch so it can be tested/merged? @magiconair thoughts of when this might be able to ship? Thanks folks! |
@evandam Frank has left the Fabio project to pursue other interests. The current owners/maintainers can be found here: https://github.com/orgs/fabiolb/people |
a55de9d
to
04f958c
Compare
Dynamically monitor file changes.
registry.backend = file
registry.file.path =/down/fabio.txt
registry.file.noroutehtmlpath=/down/404.txt
/down/fabio.txt