about summary refs log tree commit diff
path: root/app/workers/soft_block_domain_followers_worker.rb
blob: ce76683c50839383657c6aea3933df01d45d5aa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require 'sidekiq-bulk'

class SoftBlockDomainFollowersWorker
  include Sidekiq::Worker

  sidekiq_options queue: 'pull'

  def perform(account_id, domain)
    followers_id = Account.find(account_id).followers.where(domain: domain).pluck(:id)
    SoftBlockWorker.push_bulk(followers_id) do |follower_id|
      [account_id, follower_id]
    end
  end
end