Add a limit on the number of points in a GPS trace
logger.info("GPX Import importing #{name} (#{id}) from #{user.email}")
file.open do |file|
- gpx = GPX::File.new(file.path)
+ gpx = GPX::File.new(file.path, :maximum_points => Settings.max_trace_size)
f_lat = 0
f_lon = 0
end
end
+ def schedule_import
+ TraceImporterJob.new(self).enqueue(:priority => user.traces.where(:inserted => false).count)
+ end
+
+ def schedule_destruction
+ TraceDestroyerJob.perform_later(self)
+ end
+
private
def content_type(file)