~cytrogen/masto-fe

33c8708a1ac7df363bf2bd74ab8fa2ed7168379c — Claire 2 years ago 4d9186a
Change `GET /api/v1/directory` to use database replica rather than primary (#26856)

1 files changed, 3 insertions(+), 1 deletions(-)

M app/controllers/api/v1/directories_controller.rb
M app/controllers/api/v1/directories_controller.rb => app/controllers/api/v1/directories_controller.rb +3 -1
@@ 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