Time out condition after 200ms and add basic unit tests for it
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
cd7dccd30c
commit
37444acc9c
+3
-3
@@ -77,9 +77,9 @@ impl Worktree {
|
||||
pub fn scan_complete(&self) -> impl Future<Output = ()> {
|
||||
let mut scan_state_rx = self.scan_state.1.clone();
|
||||
async move {
|
||||
let mut next_scan_state = Some(scan_state_rx.borrow().clone());
|
||||
while let Some(ScanState::Scanning) = next_scan_state {
|
||||
next_scan_state = scan_state_rx.recv().await;
|
||||
let mut scan_state = Some(scan_state_rx.borrow().clone());
|
||||
while let Some(ScanState::Scanning) = scan_state {
|
||||
scan_state = scan_state_rx.recv().await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user