Skip to content

Commit

Permalink
Change markers API to use a replica
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed Jul 9, 2023
1 parent 610cf6c commit 89b4ff1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/api/v1/markers_controller.rb
Expand Up @@ -7,7 +7,10 @@ class Api::V1::MarkersController < Api::BaseController
before_action :require_user!

def index
@markers = current_user.markers.where(timeline: Array(params[:timeline])).index_by(&:timeline)
ApplicationRecord.connected_to(role: :read, prevent_writes: true) do
@markers = current_user.markers.where(timeline: Array(params[:timeline])).index_by(&:timeline)
end

render json: serialize_map(@markers)
end

Expand Down

0 comments on commit 89b4ff1

Please sign in to comment.