Skip to content

Commit

Permalink
Fix trying to delete already deleted file when post-processing (#13406)
Browse files Browse the repository at this point in the history
Fix #13403
  • Loading branch information
Gargron authored Apr 6, 2020
1 parent 2924cef commit 0773a51
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion app/workers/post_process_media_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def perform(media_attachment_id)
media_attachment = MediaAttachment.find(media_attachment_id)
media_attachment.processing = :in_progress
media_attachment.save
media_attachment.file.reprocess_original!
media_attachment.file.reprocess!(:original)
media_attachment.processing = :complete
media_attachment.save
rescue ActiveRecord::RecordNotFound
Expand Down
11 changes: 0 additions & 11 deletions lib/paperclip/attachment_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ def process_style?(style_name, style_args)
end
end

def reprocess_original!
old_original_path = path(:original)
reprocess!(:original)
new_original_path = path(:original)

if new_original_path != old_original_path
@queued_for_delete << old_original_path
flush_deletes
end
end

def variant?(other_filename)
return true if original_filename == other_filename
return false if original_filename.nil?
Expand Down

0 comments on commit 0773a51

Please sign in to comment.