Fix that can't delete media files even if "tootctl media remove" execute when "--background" not attached.

pull/8506/head
Maya Minatsuki 2018-08-29 02:03:04 +09:00
parent 5e1767173f
commit 5aa7e09645
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ class Maintenance::UncacheMediaWorker
sidekiq_options queue: 'pull'
def perform(media_attachment_id)
media = media_attachment_id.is_a?(MediaAttachment) ? media_attachment_id : MediaAttachment.find(media_attachment_id)
media = MediaAttachment.find(media_attachment_id)
return if media.file.blank?

View File

@ -34,7 +34,7 @@ module Mastodon
Maintenance::UncacheMediaWorker.push_bulk(media_attachments.map(&:id))
else
media_attachments.each do |m|
Maintenance::UncacheMediaWorker.new.perform(m)
Maintenance::UncacheMediaWorker.new.perform(m.id)
say('.', :green, false)
processed += 1
end