server: label_unprocessed handle case where files cannot be found from message-id

This commit is contained in:
Bill Thiede 2025-04-23 18:57:54 -07:00
parent bbdc35061c
commit 4665f34e54

View File

@ -987,7 +987,14 @@ pub async fn label_unprocessed(
let id = format!("id:{id}");
let files = nm.files(&id)?;
// Only process the first file path is multiple files have the same id
let path = files.iter().next().unwrap();
let Some(path) = files.iter().next() else {
error!("No files for message-ID {id}");
let t = "Letterbox/Bad";
nm.tag_add(t, &id)?;
let t = "unprocessed";
nm.tag_remove(t, &id)?;
continue;
};
let file = File::open(&path)?;
info!("parsing {path}");
let mmap = unsafe { MmapOptions::new().map(&file)? };