about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-12-03 17:24:58 -0600
committermultiple creatures <dev@multiple-creature.party>2019-12-03 17:24:58 -0600
commit273a9b94dee16d5e77172c2b79433d6c20abf4a8 (patch)
tree7374277b29998336746d5acf33ed09bfcbdd3914 /lib/tasks
parentbc81d32c2caa5a53b3326421bd8ffdb2fd4a3491 (diff)
add `monsterfork:reapply_filters` task to mass-fix users' tl filters for this update
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/monsterfork.rake12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake
index 465299562..6c2f5074a 100644
--- a/lib/tasks/monsterfork.rake
+++ b/lib/tasks/monsterfork.rake
@@ -37,4 +37,16 @@ namespace :monsterfork do
   task reindex_media_descs: :environment do
     index_statuses(Status.left_outer_joins(:media_attachments).where('media_attachments.description IS NOT NULL'))
   end
+
+  desc "Re-apply all users' filters to their home and list timelines."
+  task reapply_filters: :environment do
+    Account.local.find_each do |account|
+      Rails.logger.info("Re-applying filters for: #{account.username}")
+      FilterFeedsWorker.perform_async(account.id)
+      sleep 1
+      while Sidekiq::Queue.new.size > 5
+        sleep 1
+      end
+    end
+  end
 end