Browse Source

Fix trying to delete already deleted file when post-processing (#13406)

Fix #13403
closed-social-v3
Eugen Rochko 4 years ago
committed by GitHub
parent
commit
0773a512ac
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 12 deletions
  1. +1
    -1
      app/workers/post_process_media_worker.rb
  2. +0
    -11
      lib/paperclip/attachment_extensions.rb

+ 1
- 1
app/workers/post_process_media_worker.rb View File

@ -25,7 +25,7 @@ class PostProcessMediaWorker
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

+ 0
- 11
lib/paperclip/attachment_extensions.rb View File

@ -14,17 +14,6 @@ module Paperclip
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?

Loading…
Cancel
Save