]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/trace.rb
Raise exception if there is an error, and import tracepoints in batches
[rails.git] / app / models / trace.rb
index bd8ab72b3cfe340eb62ed068a8ac6068cab20fed..3d23d02c8d7da728c47f9234beb0a08873b6ea3f 100644 (file)
@@ -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)