From 47deb8b3da8f54cc09223a7fc6cbf804876ad571 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Thu, 25 Jul 2019 14:16:47 +0530 Subject: [PATCH] FIX: use same id for both original & optimized inventories in multisite setup. --- lib/s3_inventory.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/s3_inventory.rb b/lib/s3_inventory.rb index 309b2ef61ce..501cb91b06e 100644 --- a/lib/s3_inventory.rb +++ b/lib/s3_inventory.rb @@ -120,6 +120,8 @@ class S3Inventory def download_inventory_files_to_tmp_directory files.each do |file| + next if File.exists?(file[:filename]) + log "Downloading inventory file '#{file[:key]}' to tmp directory..." failure_message = "Failed to inventory file '#{file[:key]}' to tmp directory." @@ -257,11 +259,8 @@ class S3Inventory def inventory_id @inventory_id ||= begin - if bucket_folder_path.present? - "#{bucket_folder_path}-#{type}" - else - type - end + id = Rails.configuration.multisite ? "original" : type # TODO: rename multisite path to "uploads" + bucket_folder_path.present? ? "#{bucket_folder_path}-#{id}" : id end end