mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
17 lines
370 B
Ruby
17 lines
370 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Points::CreateJob < ApplicationJob
|
|
queue_as :points
|
|
|
|
def perform(params, user_id)
|
|
data = Points::Params.new(params, user_id).call
|
|
|
|
data.each_slice(1000) do |location_batch|
|
|
Point.upsert_all(
|
|
location_batch,
|
|
unique_by: %i[lonlat timestamp user_id],
|
|
returning: false
|
|
)
|
|
end
|
|
end
|
|
end
|