Skip to content

Commit 0773a51

Browse files
authored
Fix trying to delete already deleted file when post-processing (#13406)
Fix #13403
1 parent 2924cef commit 0773a51

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

app/workers/post_process_media_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def perform(media_attachment_id)
2525
media_attachment = MediaAttachment.find(media_attachment_id)
2626
media_attachment.processing = :in_progress
2727
media_attachment.save
28-
media_attachment.file.reprocess_original!
28+
media_attachment.file.reprocess!(:original)
2929
media_attachment.processing = :complete
3030
media_attachment.save
3131
rescue ActiveRecord::RecordNotFound

lib/paperclip/attachment_extensions.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ def process_style?(style_name, style_args)
1414
end
1515
end
1616

17-
def reprocess_original!
18-
old_original_path = path(:original)
19-
reprocess!(:original)
20-
new_original_path = path(:original)
21-
22-
if new_original_path != old_original_path
23-
@queued_for_delete << old_original_path
24-
flush_deletes
25-
end
26-
end
27-
2817
def variant?(other_filename)
2918
return true if original_filename == other_filename
3019
return false if original_filename.nil?

0 commit comments

Comments
 (0)