From: Matt Corallo Date: Wed, 29 May 2024 14:54:57 +0000 (+0000) Subject: Correct v2 symlink paths X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=dc32c31474067422c80fa75ad68a6dff96ec103b;p=rapid-gossip-sync-server Correct v2 symlink paths --- diff --git a/src/snapshot.rs b/src/snapshot.rs index 03c14ad..896783e 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -92,8 +92,8 @@ impl Snapshotter where L::Target: Logger { // channel updates // purge and recreate the pending directories - let suffixes = ["", "/v2"]; - for suffix in suffixes { + let suffixes = [("", ""), ("/v2", "../")]; + for (suffix, _) in suffixes { let versioned_snapshot_directory = format!("{}{}", pending_snapshot_directory, suffix); let versioned_symlink_directory = format!("{}{}", pending_symlink_directory, suffix); @@ -185,9 +185,9 @@ impl Snapshotter where L::Target: Logger { }; log_info!(self.logger, "i: {}, referenced scope: {}", i, referenced_scope); - for suffix in suffixes { + for (suffix, path_to_root) in suffixes { let snapshot_filename = snapshot_filenames_by_scope.get(&referenced_scope).unwrap(); - let relative_snapshot_path = format!("{}{}/{}", relative_symlink_to_snapshot_path, suffix, snapshot_filename); + let relative_snapshot_path = format!("{}{}{}/{}", path_to_root, relative_symlink_to_snapshot_path, suffix, snapshot_filename); let canonical_last_sync_timestamp = if i == 0 { // special-case 0 to always refer to a full/initial sync