Remove the update from the database when popped out

This commit is contained in:
Clément Renault 2019-10-04 17:16:34 +02:00
parent 851cc38216
commit 29229b2137
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -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),