about summary refs log tree commit diff
path: root/app/workers/soft_block_domain_followers_worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/soft_block_domain_followers_worker.rb')
-rw-r--r--app/workers/soft_block_domain_followers_worker.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/workers/soft_block_domain_followers_worker.rb b/app/workers/soft_block_domain_followers_worker.rb
new file mode 100644
index 000000000..2782d05d2
--- /dev/null
+++ b/app/workers/soft_block_domain_followers_worker.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class SoftBlockDomainFollowersWorker
+  include Sidekiq::Worker
+
+  sidekiq_options queue: 'pull'
+
+  def perform(account_id, domain)
+    Account.find(account_id).followers.where(domain: domain).pluck(:id).each do |follower_id|
+      SoftBlockWorker.perform_async(account_id, follower_id)
+    end
+  end
+end