aboutsummaryrefslogtreecommitdiff
path: root/src/object_table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-17 14:49:10 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-17 14:49:10 +0200
commit867646093b24a9bb7e4b24a7f2248615c6e03fde (patch)
tree3e4c371c507112eb7f22d319303294ea3afca732 /src/object_table.rs
parent6ce14e2c9eb1ba81add3f61377a5a83854880b42 (diff)
downloadgarage-867646093b24a9bb7e4b24a7f2248615c6e03fde.tar.gz
garage-867646093b24a9bb7e4b24a7f2248615c6e03fde.zip
Table range deletion
Diffstat (limited to 'src/object_table.rs')
-rw-r--r--src/object_table.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/object_table.rs b/src/object_table.rs
index c04a8090..fbacf2dc 100644
--- a/src/object_table.rs
+++ b/src/object_table.rs
@@ -97,13 +97,13 @@ impl TableSchema for ObjectTable {
type S = String;
type E = Object;
- async fn updated(&self, old: Option<Self::E>, new: Self::E) {
+ async fn updated(&self, old: Option<Self::E>, new: Option<Self::E>) {
let version_table = self.version_table.clone();
- self.background.spawn(async move {
+ if let (Some(old_v), Some(new_v)) = (old, new) {
// Propagate deletion of old versions
- if let Some(old_v) = old {
+ self.background.spawn(async move {
for v in old_v.versions.iter() {
- if new
+ if new_v
.versions
.binary_search_by(|nv| nv.cmp_key().cmp(&v.cmp_key()))
.is_err()
@@ -118,8 +118,8 @@ impl TableSchema for ObjectTable {
version_table.insert(&deleted_version).await?;
}
}
- }
- Ok(())
- });
+ Ok(())
+ });
+ }
}
}