aboutsummaryrefslogtreecommitdiff
path: root/src/table/table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-14 16:08:05 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-14 16:08:05 +0100
commit510b62010871e9133a98f625b85f07a7e50f6f23 (patch)
tree76aa4190c45571a1feeb92211a591501f116c63f /src/table/table.rs
parentdfc131850a09e7ceacfa98315adbef156e07e9ca (diff)
downloadgarage-510b62010871e9133a98f625b85f07a7e50f6f23.tar.gz
garage-510b62010871e9133a98f625b85f07a7e50f6f23.zip
Get rid of background::spawn
Diffstat (limited to 'src/table/table.rs')
-rw-r--r--src/table/table.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/table/table.rs b/src/table/table.rs
index 4d93102e..bbcd5971 100644
--- a/src/table/table.rs
+++ b/src/table/table.rs
@@ -14,7 +14,7 @@ use opentelemetry::{
use garage_db as db;
-use garage_util::background::{self, BackgroundRunner};
+use garage_util::background::BackgroundRunner;
use garage_util::data::*;
use garage_util::error::Error;
use garage_util::metrics::RecordDuration;
@@ -275,7 +275,11 @@ where
if not_all_same {
let self2 = self.clone();
let ent2 = ret_entry.clone();
- background::spawn(async move { self2.repair_on_read(&who[..], ent2).await });
+ tokio::spawn(async move {
+ if let Err(e) = self2.repair_on_read(&who[..], ent2).await {
+ warn!("Error doing repair on read: {}", e);
+ }
+ });
}
}
@@ -372,11 +376,12 @@ where
.into_iter()
.map(|k| ret.get(&k).unwrap().clone())
.collect::<Vec<_>>();
- background::spawn(async move {
+ tokio::spawn(async move {
for v in to_repair {
- self2.repair_on_read(&who[..], v).await?;
+ if let Err(e) = self2.repair_on_read(&who[..], v).await {
+ warn!("Error doing repair on read: {}", e);
+ }
}
- Ok(())
});
}