Add improved CLI interface for removing remote media (#8411)
./bin/tootctl media remove --days 7 --background Make the old rake task point to it
This commit is contained in:
@ -6,7 +6,7 @@ class Maintenance::DestroyMediaWorker
|
||||
sidekiq_options queue: 'pull'
|
||||
|
||||
def perform(media_attachment_id)
|
||||
media = MediaAttachment.find(media_attachment_id)
|
||||
media = media_attachment_id.is_a?(MediaAttachment) ? media_attachment_id : MediaAttachment.find(media_attachment_id)
|
||||
media.destroy
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
|
Reference in New Issue
Block a user