diff --git a/meilidb-core/src/database.rs b/meilidb-core/src/database.rs index 9bd8348b3..45ddb56b7 100644 --- a/meilidb-core/src/database.rs +++ b/meilidb-core/src/database.rs @@ -35,10 +35,13 @@ fn update_awaiter(receiver: Receiver<()>, env: heed::Env, update_fn: Arc { - if status.result.is_ok() { - if let Err(e) = writer.commit() { - error!("update transaction failed: {}", e) + match status.result { + Ok(_) => { + if let Err(e) = writer.commit() { + error!("update transaction failed: {}", e) + } } + Err(_) => writer.abort(), } if let Some(ref callback) = *update_fn.load() {