diff options
author | takayamaki <fsgiko@gmail.com> | 2017-06-04 07:11:15 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-04 00:11:15 +0200 |
commit | 3eedad27375721aaaa6e8397124989e4ead771a9 (patch) | |
tree | 08d44ddfd6c217b9311efad92daf55328568cc82 /app/workers/soft_block_domain_followers_worker.rb | |
parent | ce7c0def88b4f9ee97913002fb2d41d1832bd8af (diff) |
change sidekiq queueing to bulk push (#3536)
Diffstat (limited to 'app/workers/soft_block_domain_followers_worker.rb')
-rw-r--r-- | app/workers/soft_block_domain_followers_worker.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/workers/soft_block_domain_followers_worker.rb b/app/workers/soft_block_domain_followers_worker.rb index 2782d05d2..ce76683c5 100644 --- a/app/workers/soft_block_domain_followers_worker.rb +++ b/app/workers/soft_block_domain_followers_worker.rb @@ -1,13 +1,16 @@ # frozen_string_literal: true +require 'sidekiq-bulk' + 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) + 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 |