aboutsummaryrefslogtreecommitdiff
path: root/src/model/block.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-11 13:47:21 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-11 13:47:21 +0100
commit8d63738cb062e816fc01c6aa2b32936ad31ff65b (patch)
treed69bb200a86788e2d7cde822afb70d54f7e7f448 /src/model/block.rs
parent3214dd52dd144c99353830d7340ea158e262b06f (diff)
downloadgarage-8d63738cb062e816fc01c6aa2b32936ad31ff65b.tar.gz
garage-8d63738cb062e816fc01c6aa2b32936ad31ff65b.zip
Checkpoint: add merkle tree in data table
Diffstat (limited to 'src/model/block.rs')
-rw-r--r--src/model/block.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index 57f4c077..ba5544a3 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -127,18 +127,16 @@ impl BlockManager {
}
}
- pub async fn spawn_background_worker(self: Arc<Self>) {
+ pub fn spawn_background_worker(self: Arc<Self>) {
// Launch 2 simultaneous workers for background resync loop preprocessing
- for i in 0..2usize {
+ for i in 0..2u64 {
let bm2 = self.clone();
let background = self.system.background.clone();
tokio::spawn(async move {
- tokio::time::delay_for(Duration::from_secs(10)).await;
- background
- .spawn_worker(format!("block resync worker {}", i), move |must_exit| {
- bm2.resync_loop(must_exit)
- })
- .await;
+ tokio::time::delay_for(Duration::from_secs(10 * (i + 1))).await;
+ background.spawn_worker(format!("block resync worker {}", i), move |must_exit| {
+ bm2.resync_loop(must_exit)
+ });
});
}
}