gearheads
/
mastodon
Archived
2
0
Fork 0

Change `GET /api/v1/directory` to use database replica rather than primary (#26856)

gh/dev^2
Claire 2023-09-08 17:01:02 +02:00 committed by GitHub
parent 4d9186a48c
commit 33c8708a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ class Api::V1::DirectoriesController < Api::BaseController
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