Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add file change watch #534

wants to merge 3 commits into from

Conversation

1941198
Copy link

@1941198 1941198 commented Aug 16, 2018

Dynamically monitor file changes.
registry.backend = file
registry.file.path =/down/fabio.txt
registry.file.noroutehtmlpath=/down/404.txt

/down/fabio.txt

route add web-svc /test http://192.168.1.222:8082
route add web-svc /web http://192.168.1.222:8081

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2018

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

@1941198
Copy link
Author

1941198 commented Aug 16, 2018

cla Already agree.
image

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}
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update to commited.

return b, nil
}

func (b *be) readRoute() error {
Copy link
Contributor

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) {...}

@1941198
Copy link
Author

1941198 commented Aug 17, 2018

already updated

@scalp42
Copy link

scalp42 commented Jan 6, 2021

@1941198 any chance you can rebase against latest changes?

@magiconair or @nathanejohnson what would it take to get this merged?

@aaronhurt
Copy link
Member

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?

@scalp42
Copy link

scalp42 commented Apr 30, 2021

@leprechau we're not using this in production, we're currently running #811 that allows turning off the consistent reads.

@evandam
Copy link

evandam commented Apr 30, 2021

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!

@aaronhurt
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants