Change `GET /api/v1/directory` to use database replica rather than primary (#26856)
parent
d97f736733
commit
068c80d0bf
|
@ -16,8 +16,10 @@ class Api::V1::DirectoriesController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_accounts
|
def set_accounts
|
||||||
|
with_read_replica do
|
||||||
@accounts = accounts_scope.offset(params[:offset]).limit(limit_param(DEFAULT_ACCOUNTS_LIMIT))
|
@accounts = accounts_scope.offset(params[:offset]).limit(limit_param(DEFAULT_ACCOUNTS_LIMIT))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def accounts_scope
|
def accounts_scope
|
||||||
Account.discoverable.tap do |scope|
|
Account.discoverable.tap do |scope|
|
||||||
|
|
Loading…
Reference in New Issue