Don't create a real background executor when Fs
is fake
This commit is contained in:
parent
68f747d6df
commit
f58ef25fc5
1 changed files with 7 additions and 6 deletions
|
@ -550,14 +550,15 @@ impl Worktree {
|
||||||
let (mut tree, scan_states_tx) = LocalWorktree::new(path, languages, fs.clone(), cx);
|
let (mut tree, scan_states_tx) = LocalWorktree::new(path, languages, fs.clone(), cx);
|
||||||
let abs_path = tree.snapshot.abs_path.clone();
|
let abs_path = tree.snapshot.abs_path.clone();
|
||||||
let background_snapshot = tree.background_snapshot.clone();
|
let background_snapshot = tree.background_snapshot.clone();
|
||||||
|
let background = if fs.is_fake() {
|
||||||
|
cx.background().clone()
|
||||||
|
} else {
|
||||||
|
Arc::new(executor::Background::new())
|
||||||
|
};
|
||||||
tree._background_scanner_task = Some(cx.background().spawn(async move {
|
tree._background_scanner_task = Some(cx.background().spawn(async move {
|
||||||
let events = fs.watch(&abs_path, Duration::from_millis(100)).await;
|
let events = fs.watch(&abs_path, Duration::from_millis(100)).await;
|
||||||
let scanner = BackgroundScanner::new(
|
let scanner =
|
||||||
background_snapshot,
|
BackgroundScanner::new(background_snapshot, scan_states_tx, fs, background);
|
||||||
scan_states_tx,
|
|
||||||
fs,
|
|
||||||
Arc::new(executor::Background::new()),
|
|
||||||
);
|
|
||||||
scanner.run(events).await;
|
scanner.run(events).await;
|
||||||
}));
|
}));
|
||||||
Worktree::Local(tree)
|
Worktree::Local(tree)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue