From fd7fbe59e4741001806c9287d5ccca1c9c280b75 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Tue, 20 Oct 2026 09:17:09 -0400 Subject: [PATCH] LRC-LIB-LIBFOLDERS: a scan cancelled during its listing asks the disk nothing more The cancelled result is never used, but scan_files still checked each listed file's cached probe against the file. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/sync.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/engine/src/sync.rs b/crates/engine/src/sync.rs index 6f641fa22..713c697a7 100644 --- a/crates/engine/src/sync.rs +++ b/crates/engine/src/sync.rs @@ -242,6 +242,11 @@ pub fn scan_with(input: SyncInput, progress: &SyncProgress) -> FolderChanges { }), ); progress.listed.store(true, std::sync::atomic::Ordering::Release); + // ✕ during the listing: its result is not used, so nothing more is asked of the disk (the files' cached probes + // would each be checked against the file, a round trip per file on a network share) + if progress.files.cancel.load(std::sync::atomic::Ordering::Relaxed) { + return FolderChanges { path: folder, seen, ..Default::default() }; + } let listing = &listing; // (no threads on the web: one after the other there) #[cfg(target_arch = "wasm32")]