From dc32c31474067422c80fa75ad68a6dff96ec103b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 29 May 2024 14:54:57 +0000 Subject: [PATCH] Correct v2 symlink paths --- src/snapshot.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.39.5