Commit 9ef5532a authored by abcang's avatar abcang Committed by Eugen Rochko

Fix follow requests N+1 (#12004)

parent 3babf846
......@@ -21,7 +21,7 @@ class UpdateAccountService < BaseService
def authorize_all_follow_requests(account)
follow_requests = FollowRequest.where(target_account: account)
follow_requests = { |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]
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment