Raise exception if there is an error, and import tracepoints in batches
This commit is contained in:
parent
400db58036
commit
07fdcf638e
1 changed files with 1 additions and 1 deletions
|
@ -313,7 +313,7 @@ class Trace < ActiveRecord::Base
|
||||||
tp.run_callbacks(:save) { false }
|
tp.run_callbacks(:save) { false }
|
||||||
tp.run_callbacks(:create) { false }
|
tp.run_callbacks(:create) { false }
|
||||||
end
|
end
|
||||||
Tracepoint.import(tracepoints)
|
Tracepoint.import!(tracepoints, :batch_size => 1_000)
|
||||||
|
|
||||||
if gpx.actual_points.positive?
|
if gpx.actual_points.positive?
|
||||||
max_lat = Tracepoint.where(:gpx_id => id).maximum(:latitude)
|
max_lat = Tracepoint.where(:gpx_id => id).maximum(:latitude)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue