Browse Source

Fix follow requests N+1 (#12004)

pull/4/head
abcang 4 years ago
committed by Eugen Rochko
parent
commit
9ef5532a7e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/services/update_account_service.rb

+ 1
- 1
app/services/update_account_service.rb View File

@ -21,7 +21,7 @@ class UpdateAccountService < BaseService
def authorize_all_follow_requests(account)
follow_requests = FollowRequest.where(target_account: account)
follow_requests = follow_requests.select { |req| !req.account.silenced? }
follow_requests = follow_requests.preload(:account).select { |req| !req.account.silenced? }
AuthorizeFollowWorker.push_bulk(follow_requests) do |req|
[req.account_id, req.target_account_id]
end

Loading…
Cancel
Save