diff --git a/app/workers/maintenance/uncache_media_worker.rb b/app/workers/maintenance/uncache_media_worker.rb index 4bc62ef755..2d1a670a76 100644 --- a/app/workers/maintenance/uncache_media_worker.rb +++ b/app/workers/maintenance/uncache_media_worker.rb @@ -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? diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb index ee28270da7..f9204395f5 100644 --- a/lib/mastodon/media_cli.rb +++ b/lib/mastodon/media_cli.rb @@ -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