diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-10 22:46:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-10 22:46:02 +0100 |
commit | 6c920d9ac80fca5de3c5c536107c1e14580cae85 (patch) | |
tree | a66dd53b5ac61976eb94c8ed535efd949bbaf998 /crates/vfs-notify | |
parent | 65984773d347badfbde4fa013a28b2a0d7e5a0e3 (diff) | |
parent | dac9a4cebd39e7865235530fa69e5ae4ab42962b (diff) |
Merge #5301
5301: Don't spawn notify unnecessary r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/vfs-notify')
-rw-r--r-- | crates/vfs-notify/src/include.rs | 1 | ||||
-rw-r--r-- | crates/vfs-notify/src/lib.rs | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/crates/vfs-notify/src/include.rs b/crates/vfs-notify/src/include.rs index 72f928536..59da3d77a 100644 --- a/crates/vfs-notify/src/include.rs +++ b/crates/vfs-notify/src/include.rs | |||
@@ -1,5 +1,4 @@ | |||
1 | //! See `Include`. | 1 | //! See `Include`. |
2 | |||
3 | use std::convert::TryFrom; | 2 | use std::convert::TryFrom; |
4 | 3 | ||
5 | use globset::{Glob, GlobSet, GlobSetBuilder}; | 4 | use globset::{Glob, GlobSet, GlobSetBuilder}; |
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index ee5035554..6aaa53f63 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs | |||
@@ -82,11 +82,13 @@ impl NotifyActor { | |||
82 | Event::Message(msg) => match msg { | 82 | Event::Message(msg) => match msg { |
83 | Message::Config(config) => { | 83 | Message::Config(config) => { |
84 | self.watcher = None; | 84 | self.watcher = None; |
85 | let (watcher_sender, watcher_receiver) = unbounded(); | 85 | if !config.watch.is_empty() { |
86 | let watcher = log_notify_error(Watcher::new_immediate(move |event| { | 86 | let (watcher_sender, watcher_receiver) = unbounded(); |
87 | watcher_sender.send(event).unwrap() | 87 | let watcher = log_notify_error(Watcher::new_immediate(move |event| { |
88 | })); | 88 | watcher_sender.send(event).unwrap() |
89 | self.watcher = watcher.map(|it| (it, watcher_receiver)); | 89 | })); |
90 | self.watcher = watcher.map(|it| (it, watcher_receiver)); | ||
91 | } | ||
90 | 92 | ||
91 | let n_total = config.load.len(); | 93 | let n_total = config.load.len(); |
92 | self.send(loader::Message::Progress { n_total, n_done: 0 }); | 94 | self.send(loader::Message::Progress { n_total, n_done: 0 }); |