From 823614c214d81fe0f8325a897be2bf7776cf0b7f Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 9 Jul 2024 15:06:00 +1000 Subject: [PATCH] Always delete uploaded file on error The file path was never going to be 'tmp/product_import', so I guess it never deleted the file. Hmm but shouldn't we clean up on success too? I suppose the tmp dir will be cleaned up eventually, and maybe we want to keep them for debugging purposes. --- app/models/product_import/product_importer.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models/product_import/product_importer.rb b/app/models/product_import/product_importer.rb index 1967245fb8..2cdfba52bd 100644 --- a/app/models/product_import/product_importer.rb +++ b/app/models/product_import/product_importer.rb @@ -287,8 +287,6 @@ module ProductImport end def delete_uploaded_file - return unless @file.path == Rails.root.join("tmp/product_import").to_s - File.delete(@file) end