From b18ebc964811d8d256c432a547de3885668c7f4a Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 4 Nov 2022 17:50:46 +0000 Subject: [PATCH] PERF: Correct should_skip? logic in `s3:upload` (#18862) This task is supposed to skip uploading if the asset is already present in S3. However, when a bucket 'folder path' was configured, this logic was broken and so the assets would be re-uploaded every time. This commit fixes that logic to include the bucket 'folder path' in the check --- lib/tasks/s3.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake index b8aa43eee4f..e8ef8da6d9d 100644 --- a/lib/tasks/s3.rake +++ b/lib/tasks/s3.rake @@ -13,6 +13,7 @@ end def should_skip?(path) return false if ENV['FORCE_S3_UPLOADS'] @existing_assets ||= Set.new(helper.list("assets/").map(&:key)) + path = File.join(helper.s3_bucket_folder_path, path) if helper.s3_bucket_folder_path @existing_assets.include?(path) end