diff options
author | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-06-12 13:17:21 +0000 |
---|---|---|
committer | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-06-12 13:17:21 +0000 |
commit | 4d8d1fa129b5f8692311de211203bc18c614951f (patch) | |
tree | e9a1130c9a9e5a5b8babd2ba3153e4ed03a4581e /app/workers | |
parent | 34f1fd2a621ca869c17009487e2f10063812fbd0 (diff) | |
parent | 6151308c47efb0e05bcb2c54aa1693f5ff04da5c (diff) |
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/after_account_domain_block_worker.rb | 11 | ||||
-rw-r--r-- | app/workers/soft_block_domain_followers_worker.rb | 14 | ||||
-rw-r--r-- | app/workers/soft_block_worker.rb | 17 |
3 files changed, 11 insertions, 31 deletions
diff --git a/app/workers/after_account_domain_block_worker.rb b/app/workers/after_account_domain_block_worker.rb new file mode 100644 index 000000000..043c33311 --- /dev/null +++ b/app/workers/after_account_domain_block_worker.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AfterAccountDomainBlockWorker + include Sidekiq::Worker + + def perform(account_id, domain) + AfterBlockDomainFromAccountService.new.call(Account.find(account_id), domain) + rescue ActiveRecord::RecordNotFound + true + end +end diff --git a/app/workers/soft_block_domain_followers_worker.rb b/app/workers/soft_block_domain_followers_worker.rb deleted file mode 100644 index 85445c7fb..000000000 --- a/app/workers/soft_block_domain_followers_worker.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -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 diff --git a/app/workers/soft_block_worker.rb b/app/workers/soft_block_worker.rb deleted file mode 100644 index 312d880b9..000000000 --- a/app/workers/soft_block_worker.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class SoftBlockWorker - include Sidekiq::Worker - - sidekiq_options queue: 'pull' - - def perform(account_id, target_account_id) - account = Account.find(account_id) - target_account = Account.find(target_account_id) - - BlockService.new.call(account, target_account) - UnblockService.new.call(account, target_account) - rescue ActiveRecord::RecordNotFound - true - end -end |