about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-12 04:19:04 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-12 04:19:04 +0100
commit8f54a8851a64ffa3cff4604dc798ff428b6da95e (patch)
tree2bb3fc3f9091b15794b32b42f8a40fd3628fc686 /lib
parent4a2ee43e807b0d3fd55ed26f9d03c8e39ea6e486 (diff)
Add rake task for clearing out media from silenced accounts
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/mastodon.rake5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index a95a7258f..13220f68e 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -6,6 +6,11 @@ namespace :mastodon do
     task clear: :environment do
       MediaAttachment.where(status_id: nil).where('created_at < ?', 1.day.ago).find_each(&:destroy)
     end
+
+    desc 'Remove media attachments attributed to silenced accounts'
+    task remove_silenced: :environment do
+      MediaAttachment.where(account: Account.silenced).find_each(&:destroy)
+    end
   end
 
   namespace :push do