logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

soft_block_domain_followers_worker.rb (384B)


  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