Skip to content

Commit

Permalink
Change GET /api/v1/directory to use database replica rather than pr…
Browse files Browse the repository at this point in the history
…imary (mastodon#26856)
  • Loading branch information
ClearlyClaire authored Sep 8, 2023
1 parent 4d9186a commit 33c8708
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/api/v1/directories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def require_enabled!
end

def set_accounts
@accounts = accounts_scope.offset(params[:offset]).limit(limit_param(DEFAULT_ACCOUNTS_LIMIT))
with_read_replica do
@accounts = accounts_scope.offset(params[:offset]).limit(limit_param(DEFAULT_ACCOUNTS_LIMIT))
end
end

def accounts_scope
Expand Down

0 comments on commit 33c8708

Please sign in to comment.