server: label_unprocessed handle case where files cannot be found from message-id
This commit is contained in:
parent
bbdc35061c
commit
4665f34e54
@ -987,7 +987,14 @@ pub async fn label_unprocessed(
|
|||||||
let id = format!("id:{id}");
|
let id = format!("id:{id}");
|
||||||
let files = nm.files(&id)?;
|
let files = nm.files(&id)?;
|
||||||
// Only process the first file path is multiple files have the same 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)?;
|
let file = File::open(&path)?;
|
||||||
info!("parsing {path}");
|
info!("parsing {path}");
|
||||||
let mmap = unsafe { MmapOptions::new().map(&file)? };
|
let mmap = unsafe { MmapOptions::new().map(&file)? };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user