]> cat aescling's git repositories - mastodon.git/commitdiff
Fix trying to delete already deleted file when post-processing (#13406)
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 6 Apr 2020 12:11:22 +0000 (14:11 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Apr 2020 12:11:22 +0000 (14:11 +0200)
Fix #13403

app/workers/post_process_media_worker.rb
lib/paperclip/attachment_extensions.rb

index d3ebda194a34fad25adc45caad975777321f81cf..148ae5e2be087388ee203c872745cfb9a8fd38b7 100644 (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
index d9ec0159adb3291ded2ac57e204a01515277cd8d..ce5780557922ea1d642bedc57fb222acac2445f3 100644 (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?