From: Andy Allan Date: Wed, 6 Mar 2019 08:27:33 +0000 (+0100) Subject: Raise exception if there is an error, and import tracepoints in batches X-Git-Tag: live~2675^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/07fdcf638ea8f7200b561f4cc190f231929cda0b Raise exception if there is an error, and import tracepoints in batches --- diff --git a/app/models/trace.rb b/app/models/trace.rb index bd8ab72b3..3d23d02c8 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -313,7 +313,7 @@ class Trace < ActiveRecord::Base tp.run_callbacks(:save) { false } tp.run_callbacks(:create) { false } end - Tracepoint.import(tracepoints) + Tracepoint.import!(tracepoints, :batch_size => 1_000) if gpx.actual_points.positive? max_lat = Tracepoint.where(:gpx_id => id).maximum(:latitude)