From a04218047ece73aff8ef0647ae55d3f496f709f3 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 21 Apr 2020 16:15:32 +0000 Subject: [PATCH] Do full sync on node (re)start --- src/table_sync.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/table_sync.rs b/src/table_sync.rs index bfbde28..aa0610e 100644 --- a/src/table_sync.rs +++ b/src/table_sync.rs @@ -18,7 +18,7 @@ use crate::membership::Ring; use crate::table::*; const MAX_DEPTH: usize = 16; -const SCAN_INTERVAL: Duration = Duration::from_secs(1800); +const SCAN_INTERVAL: Duration = Duration::from_secs(3600); const CHECKSUM_CACHE_TIMEOUT: Duration = Duration::from_secs(1800); const TABLE_SYNC_RPC_TIMEOUT: Duration = Duration::from_secs(30); @@ -131,6 +131,13 @@ where ) .await; + let s3 = syncer.clone(); + table.system.background.spawn(async move { + tokio::time::delay_for(Duration::from_secs(20)).await; + s3.add_full_scan().await; + Ok(()) + }); + syncer }