summaryrefslogtreecommitdiff
path: root/cli/util/file_watcher.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/util/file_watcher.rs')
-rw-r--r--cli/util/file_watcher.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs
index 05415f2a6..1ad5e9ba0 100644
--- a/cli/util/file_watcher.rs
+++ b/cli/util/file_watcher.rs
@@ -304,6 +304,13 @@ where
}
loop {
+ // We may need to give the runtime a tick to settle, as cancellations may need to propagate
+ // to tasks. We choose yielding 10 times to the runtime as a decent heuristic. If watch tests
+ // start to fail, this may need to be increased.
+ for _ in 0..10 {
+ tokio::task::yield_now().await;
+ }
+
let mut watcher = new_watcher(watcher_sender.clone())?;
consume_paths_to_watch(&mut watcher, &mut paths_to_watch_receiver);