mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-03 05:29:07 +00:00
Fix that can't delete media files even if "tootctl media remove" execute when "--background" not attached.
This commit is contained in:
parent
5e1767173f
commit
5aa7e09645
|
@ -6,7 +6,7 @@ class Maintenance::UncacheMediaWorker
|
||||||
sidekiq_options queue: 'pull'
|
sidekiq_options queue: 'pull'
|
||||||
|
|
||||||
def perform(media_attachment_id)
|
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?
|
return if media.file.blank?
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ module Mastodon
|
||||||
Maintenance::UncacheMediaWorker.push_bulk(media_attachments.map(&:id))
|
Maintenance::UncacheMediaWorker.push_bulk(media_attachments.map(&:id))
|
||||||
else
|
else
|
||||||
media_attachments.each do |m|
|
media_attachments.each do |m|
|
||||||
Maintenance::UncacheMediaWorker.new.perform(m)
|
Maintenance::UncacheMediaWorker.new.perform(m.id)
|
||||||
say('.', :green, false)
|
say('.', :green, false)
|
||||||
processed += 1
|
processed += 1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue