superfly / litefs

FUSE-based file system for replicating SQLite databases across a cluster of machines
Apache License 2.0
3.95k stars 95 forks source link

Proxy primary redirect timeout #408

Closed benbjohnson closed 1 year ago

benbjohnson commented 1 year ago

This pull request changes the HTTP proxy so that it will wait until it has primary information before attempting to redirect. It will wait up to 5 seconds by default but this can be changed in the config.

Fixes https://github.com/superfly/litefs/issues/406

Config

To change the primary redirect timeout, you can specify it in the proxy section of the config:

proxy:
  addr: ":8080"
  target: "localhost:8081"
  db: "my.db"
  primary-redirect-timeout: "10s"