Improve api/v1/markers#create performance against simultaneous requests (#28718)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2024-01-15 09:47:25 +00:00
1 parent cc3ff66246
commit e72676e83a
2 files changed
+12 -14

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ class Api::V1::MarkersController < Api::BaseController
@markers = {}
resource_params.each_pair do |timeline, timeline_params|
@markers[timeline] = current_user.markers.find_or_initialize_by(timeline: timeline)
@markers[timeline] = current_user.markers.find_or_create_by(timeline: timeline)
@markers[timeline].update!(timeline_params)
end
end