Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

fix: use asset manifest for sync op #1976

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/sites/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ pub fn sync(
}
}

let (pairs, asset_manifest, _): (Vec<KeyValuePair>, AssetManifest, _) =
let (diff_files_to_upload, asset_manifest, _): (Vec<KeyValuePair>, AssetManifest, _) =
directory_keys_values(target, path, Some(&remote_keys))?;

// Now delete files from Workers KV that exist in remote but no longer exist locally.
// Get local keys
let mut local_keys: HashSet<_> = HashSet::new();
for pair in pairs.iter() {
local_keys.insert(pair.key.clone());
for (_, asset_key) in asset_manifest.iter() {
local_keys.insert(asset_key.clone());
}

// Find keys that are present in remote but not present in local, and
Expand All @@ -57,5 +57,5 @@ pub fn sync(
.collect();

StdErr::success("Success");
Ok((pairs, to_delete, asset_manifest))
Ok((diff_files_to_upload, to_delete, asset_manifest))
}