From 8d0c69529acbcd896155e466e29d73b84988d180 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 12 Jul 2023 18:57:40 +0200 Subject: [PATCH] Change markers API to use a replica (#25851) --- app/controllers/api/v1/markers_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/markers_controller.rb b/app/controllers/api/v1/markers_controller.rb index 867e6facf4..f8dfba8a94 100644 --- a/app/controllers/api/v1/markers_controller.rb +++ b/app/controllers/api/v1/markers_controller.rb @@ -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) + with_read_replica do + @markers = current_user.markers.where(timeline: Array(params[:timeline])).index_by(&:timeline) + end + render json: serialize_map(@markers) end