fix: some search results missing due to broken symlinks (#665)

This commit is contained in:
sigoden
2026-01-21 12:00:57 +08:00
committed by GitHub
parent 2b2c7bd5f7
commit bc27c8c479

View File

@@ -1881,10 +1881,14 @@ where
for dir in access_paths.entry_paths(&path) { for dir in access_paths.entry_paths(&path) {
let mut it = WalkDir::new(&dir).follow_links(true).into_iter(); let mut it = WalkDir::new(&dir).follow_links(true).into_iter();
it.next(); it.next();
while let Some(Ok(entry)) = it.next() { while let Some(entry) = it.next() {
if !running.load(atomic::Ordering::SeqCst) { if !running.load(atomic::Ordering::SeqCst) {
break; break;
} }
let entry = match entry {
Ok(v) => v,
Err(_) => continue,
};
let entry_path = entry.path(); let entry_path = entry.path();
let base_name = get_file_name(entry_path); let base_name = get_file_name(entry_path);
let is_dir = entry.file_type().is_dir(); let is_dir = entry.file_type().is_dir();