aboutsummaryrefslogtreecommitdiff
path: root/src/object_table.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/object_table.rs')
-rw-r--r--src/object_table.rs37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/object_table.rs b/src/object_table.rs
index 59ce3b7f..0d0de146 100644
--- a/src/object_table.rs
+++ b/src/object_table.rs
@@ -4,6 +4,7 @@ use std::sync::Arc;
use crate::background::BackgroundRunner;
use crate::data::*;
+use crate::error::Error;
use crate::table::*;
use crate::table_sharded::*;
@@ -101,30 +102,28 @@ impl TableSchema for ObjectTable {
type E = Object;
type Filter = ();
- async fn updated(&self, old: Option<Self::E>, new: Option<Self::E>) {
+ async fn updated(&self, old: Option<Self::E>, new: Option<Self::E>) -> Result<(), Error> {
let version_table = self.version_table.clone();
if let (Some(old_v), Some(new_v)) = (old, new) {
// Propagate deletion of old versions
- self.background.spawn(async move {
- for v in old_v.versions.iter() {
- if new_v
- .versions
- .binary_search_by(|nv| nv.cmp_key().cmp(&v.cmp_key()))
- .is_err()
- {
- let deleted_version = Version {
- uuid: v.uuid.clone(),
- deleted: true,
- blocks: vec![],
- bucket: old_v.bucket.clone(),
- key: old_v.key.clone(),
- };
- version_table.insert(&deleted_version).await?;
- }
+ for v in old_v.versions.iter() {
+ if new_v
+ .versions
+ .binary_search_by(|nv| nv.cmp_key().cmp(&v.cmp_key()))
+ .is_err()
+ {
+ let deleted_version = Version {
+ uuid: v.uuid.clone(),
+ deleted: true,
+ blocks: vec![],
+ bucket: old_v.bucket.clone(),
+ key: old_v.key.clone(),
+ };
+ version_table.insert(&deleted_version).await?;
}
- Ok(())
- });
+ }
}
+ Ok(())
}
fn matches_filter(_entry: &Self::E, _filter: &Self::Filter) -> bool {