aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src/watch_cfg.rs
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade to newer version of config crate.Nick Mathewson2022-02-251-0/+1
|
* Properly linkify two doc comment xrefs to issuesIan Jackson2022-02-041-2/+2
| | | | | | | | | | | | | | | | | | | | | Fixes these messages: warning: this URL is not a hyperlink --> crates/arti/src/watch_cfg.rs:115:5 | 115 | /// https://github.com/notify-rs/notify/issues/165 and | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/notify-rs/notify/issues/165>` | = note: `#[warn(rustdoc::bare_urls)]` on by default = note: bare URLs are not automatically turned into clickable links warning: this URL is not a hyperlink --> crates/arti/src/watch_cfg.rs:116:5 | 116 | /// https://github.com/notify-rs/notify/pull/166 . | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/notify-rs/notify/pull/166>` | = note: bare URLs are not automatically turned into clickable links
* Document that `notify` behavior is strange with symlinksNick Mathewson2022-02-031-0/+5
| | | | | | | | | | (More specifically, `notify` behaves differently on different platforms. On some, it can watch specific directory objects on the filesystem, and so it only notices when _those_ directories change. If you change a symlink so that the canonical configuration file location is now in some other directory, `notify` won't notice. But on other platforms, notify just does "stat()" in a loop. On those, it _will_ notice if the configuration file changes.)
* Avoid a potential infinite loop in configuration-watchingNick Mathewson2022-02-031-2/+5
| | | | | | | | | | | Since the user can put their logfiles and configuration files in the same directory, writing to the log can trigger an event from `notify`. If we log every non-interesting event from `notify`, then we'll trigger the logs every time we log, and fill up the disk. This commit removes the offending log and adds a comment about why. If we someday decide we do need to log here, maybe we can rate-limit the messages or something.
* Treat rescan events as meaning "reload configuration".Nick Mathewson2022-02-031-2/+2
|
* Add a couple of TODOs about configuration-watching.Nick Mathewson2022-02-021-0/+7
|
* Before reloading configuration, drain all pending file changesNick Mathewson2022-02-021-0/+8
| | | | | This way, if there are a bunch of changes at once, we only reload one time.
* Refactor file-watching code to watch parent directories.Nick Mathewson2022-02-021-8/+105
| | | | | | | | | | | | | Due to limitations in notify and the OS APIs it uses, it isn't actually so useful to watch a single file. Instead, we have to watch the directories that contain the files, and filter out any events that aren't about the specific files we care about. I've put the logic here into a new type, but I've left the type un-exported: its API is pretty ugly, inasmuch as the caller needs to jump through hoops to only get the events that they want. That's not too bad so long as the API is private, but we'd want better if we were exposing this.
* Detect changes in non-client configuration sections tooNick Mathewson2022-02-011-7/+26
| | | | We don't yet do much with these, but we can avoid discarding them.
* Reload configuration when our configuration files change.Nick Mathewson2022-02-011-0/+64
Closes #270