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.
This commit is contained in:
David Cook
2024-07-09 15:06:00 +10:00
parent cc1fa7f563
commit 823614c214

View File

@@ -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