Merge #5301
5301: Don't spawn notify unnecessary r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
6c920d9ac8
@ -182,6 +182,7 @@ impl GlobalState {
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let watch = match self.config.files.watcher {
|
||||
FilesWatcher::Client => vec![],
|
||||
FilesWatcher::Notify => project_folders.watch,
|
||||
|
@ -1,5 +1,4 @@
|
||||
//! See `Include`.
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use globset::{Glob, GlobSet, GlobSetBuilder};
|
||||
|
@ -82,11 +82,13 @@ impl NotifyActor {
|
||||
Event::Message(msg) => match msg {
|
||||
Message::Config(config) => {
|
||||
self.watcher = None;
|
||||
let (watcher_sender, watcher_receiver) = unbounded();
|
||||
let watcher = log_notify_error(Watcher::new_immediate(move |event| {
|
||||
watcher_sender.send(event).unwrap()
|
||||
}));
|
||||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||
if !config.watch.is_empty() {
|
||||
let (watcher_sender, watcher_receiver) = unbounded();
|
||||
let watcher = log_notify_error(Watcher::new_immediate(move |event| {
|
||||
watcher_sender.send(event).unwrap()
|
||||
}));
|
||||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||
}
|
||||
|
||||
let n_total = config.load.len();
|
||||
self.send(loader::Message::Progress { n_total, n_done: 0 });
|
||||
|
Loading…
x
Reference in New Issue
Block a user