X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0c2f5a8ad1568d3667363c5024faaf5f2ac10b8e..2dfe6f3f2e911101f4e4e3b90a00e2ae97725d04:/app/models/trace.rb diff --git a/app/models/trace.rb b/app/models/trace.rb index 2411fb9b7..818cc363b 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -202,7 +202,7 @@ class Trace < ApplicationRecord 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 @@ -267,6 +267,14 @@ class Trace < ApplicationRecord 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)