Fix the update system to always consume updates even if failing

This commit is contained in:
Clément Renault 2019-10-31 17:27:58 +01:00
parent b73874bf24
commit 6b326a45d7
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
4 changed files with 52 additions and 30 deletions

View file

@ -152,12 +152,9 @@ pub fn next_update_id(
pub fn update_task(
writer: &mut heed::RwTxn,
index: store::Index,
) -> MResult<Option<ProcessedUpdateResult>> {
let (update_id, update) = match index.updates.pop_front(writer)? {
Some(value) => value,
None => return Ok(None),
};
update_id: u64,
update: Update,
) -> MResult<ProcessedUpdateResult> {
debug!("Processing update number {}", update_id);
let (update_type, result, duration) = match update {
@ -308,9 +305,5 @@ pub fn update_task(
detailed_duration,
};
index
.updates_results
.put_update_result(writer, update_id, &status)?;
Ok(Some(status))
Ok(status)
}