fix filtered out pending update

This commit is contained in:
Marin Postma 2021-04-13 18:11:37 +02:00
parent b626d02ffe
commit 2b154524bb
No known key found for this signature in database
GPG Key ID: D5241F0C0C865F30

View File

@ -331,7 +331,18 @@ where
.pending_meta
.prefix_iter(&rtxn, index_uuid.as_bytes())?
.filter_map(Result::ok)
.filter_map(|(_, p)| (Some(p.id()) != processing.as_ref().map(|p| p.1.id())).then(|| p))
.filter_map(|(_, p)| {
if let Some((uuid, ref processing)) = *processing {
// Filter out the currently processing update if it is from this index.
if uuid == index_uuid && processing.id() == p.id() {
None
} else {
Some(p)
}
} else {
Some(p)
}
})
.map(UpdateStatus::from);
updates.extend(pending);