Expand description
Reload when the config file or a certificate changes (watch = true, #10).
A background thread polls the size and modification time of
rws.config.toml (or RWS_CONFIG_FILE) and of every configured TLS
certificate and key once a second. A change that looks the same on two
polls in a row — an editor or certbot finished writing — triggers the
same validated reload as SIGHUP (crate::config_reload::request_reload):
a broken config is rejected and the running one keeps serving. The set of
files is re-read on every poll, so a reload that points at new
certificates starts watching them. Off by default, like Caddy’s --watch.
Structs§
- Watcher
- Change detection, one
Watcher::pollper interval.
Constants§
- POLL_
INTERVAL - How often the files are checked.
- RWS_
CONFIG_ WATCH RWS_CONFIG_WATCH:trueto reload when a watched file changes.
Functions§
- enabled
- Whether
RWS_CONFIG_WATCHis on. - start
- Start the watcher thread when
RWS_CONFIG_WATCHis on; therwsbinary calls it after reading its configuration. - watched_
paths - The files whose change means a reload: the config file and every configured certificate and key (the default pair and each virtual host’s).