Skip to content

Downgrade notify and use RecommendedWatcher #9770

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

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/vfs-notify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rustc-hash = "1.0"
jod-thread = "0.1.0"
walkdir = "2.3.1"
crossbeam-channel = "0.5.0"
notify = "=5.0.0-pre.11"
notify = "=5.0.0-pre.10" # check that it builds on NetBSD before upgrading

vfs = { path = "../vfs", version = "0.0.0" }
paths = { path = "../paths", version = "0.0.0" }
9 changes: 5 additions & 4 deletions crates/vfs-notify/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ impl NotifyActor {
self.watcher = None;
if !config.watch.is_empty() {
let (watcher_sender, watcher_receiver) = unbounded();
let watcher = log_notify_error(RecommendedWatcher::new(move |event| {
watcher_sender.send(event).unwrap()
}));
let watcher =
Copy link
Member Author

Choose a reason for hiding this comment

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

This used to say Watcher::new_immediate, TBH I'm not even sure how that works 😅.

log_notify_error(RecommendedWatcher::new_immediate(move |event| {
watcher_sender.send(event).unwrap()
}));
self.watcher = watcher.map(|it| (it, watcher_receiver));
}

Expand Down Expand Up @@ -214,7 +215,7 @@ impl NotifyActor {

fn watch(&mut self, path: AbsPathBuf) {
if let Some((watcher, _)) = &mut self.watcher {
log_notify_error(watcher.watch(path.as_ref(), RecursiveMode::NonRecursive));
log_notify_error(watcher.watch(&path, RecursiveMode::NonRecursive));
}
}
fn send(&mut self, msg: loader::Message) {
Expand Down