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:
parent
ce59e57e6d
commit
8d078ed4e2
3 changed files with 14 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue