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:
parent
b4fc810bc3
commit
793eea2982
7 changed files with 68 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue