From 7eda680f9e4faf746835d46590e58f4fcfe3b64e Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 16 Jul 2023 20:41:00 +0000 Subject: [PATCH] Only generate as many symlinks as we need (rather than 27 years worth) --- src/snapshot.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/snapshot.rs b/src/snapshot.rs index 96c1e4d..4a86f98 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -105,7 +105,9 @@ impl Snapshotter where L::Target: Logger { symlink(&relative_dummy_snapshot_path, &dummy_symlink_path).unwrap(); } - for i in 0..10_001u64 { + // Number of intervals since Jan 1, 2022, a few months before RGS server was released. + let symlink_count = (reference_timestamp - 1640995200) / config::SNAPSHOT_CALCULATION_INTERVAL as u64; + for i in 0..symlink_count { // let's create non-dummy-symlinks // first, determine which snapshot range should be referenced -- 2.30.2