You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
384 B

  1. # frozen_string_literal: true
  2. require 'sidekiq-bulk'
  3. class SoftBlockDomainFollowersWorker
  4. include Sidekiq::Worker
  5. sidekiq_options queue: 'pull'
  6. def perform(account_id, domain)
  7. followers_id = Account.find(account_id).followers.where(domain: domain).pluck(:id)
  8. SoftBlockWorker.push_bulk(followers_id) do |follower_id|
  9. [account_id, follower_id]
  10. end
  11. end
  12. end