This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/workers/soft_block_domain_followers_worker.rb
2017-06-04 00:11:15 +02:00

17 lines
384 B
Ruby

# 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