From 29229b213773d2bc30e485e3b30c10268a301b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Fri, 4 Oct 2019 17:16:34 +0200 Subject: [PATCH] Remove the update from the database when popped out --- meilidb-core/src/store/updates.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meilidb-core/src/store/updates.rs b/meilidb-core/src/store/updates.rs index e6f6f0786..bd734eb03 100644 --- a/meilidb-core/src/store/updates.rs +++ b/meilidb-core/src/store/updates.rs @@ -73,6 +73,11 @@ impl Updates { match last_data { Some(Value::Blob(bytes)) => { let update = rmp_serde::from_read_ref(&bytes)?; + + // remove it from the database now + let last_id_bytes = last_id.to_be_bytes(); + self.updates.delete(writer, last_id_bytes)?; + Ok(Some((last_id, update))) }, Some(value) => panic!("invalid type {:?}", value),