Don't block when emitting fs events
Blocking could happen while processing events, which would cause the background scanner to never make any further progress.
This commit is contained in:
@@ -386,7 +386,7 @@ impl Worktree {
|
||||
if worktree.poll_task.is_none() {
|
||||
worktree.poll_task = Some(cx.spawn(|this, mut cx| async move {
|
||||
if is_fake_fs {
|
||||
smol::future::yield_now().await;
|
||||
cx.background().simulate_random_delay().await;
|
||||
} else {
|
||||
smol::Timer::after(Duration::from_millis(100)).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user