X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fsnapshot.rs;h=28d0768d65ede059651d16bcf6dc3421a681ce58;hb=4e8de7598a2bdba675ea5918c4d0013dbcf77a9a;hp=65f6fad03823b56cedd249c2eff87e137dcc56b9;hpb=858c7f23cee5fd36b5fa77232412d0cc106b1f76;p=rapid-gossip-sync-server diff --git a/src/snapshot.rs b/src/snapshot.rs index 65f6fad..28d0768 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -25,8 +25,10 @@ impl Snapshotter where L::Target: Logger { pub(crate) async fn snapshot_gossip(&self) { log_info!(self.logger, "Initiating snapshotting service"); + let calc_interval = config::calculate_interval(); let snapshot_sync_day_factors = [1, 2, 3, 4, 5, 6, 7, 14, 21, u64::MAX]; const DAY_SECONDS: u64 = 60 * 60 * 24; + let round_day_seconds = calc_interval as u64; let pending_snapshot_directory = format!("{}/snapshots_pending", cache_path()); let pending_symlink_directory = format!("{}/symlinks_pending", cache_path()); @@ -41,7 +43,7 @@ impl Snapshotter where L::Target: Logger { let reference_timestamp = Self::round_down_to_nearest_multiple(snapshot_generation_timestamp, config::SNAPSHOT_CALCULATION_INTERVAL as u64); log_info!(self.logger, "Capturing snapshots at {} for: {}", snapshot_generation_timestamp, reference_timestamp); - // 2. sleep until the next round 24 hours + // 2. sleep until the next round interval // 3. refresh all snapshots // the stored snapshots should adhere to the following format