]> git.openstreetmap.org Git - rails.git/commitdiff
Reduce priority of multiple simulataneous trace imports
authorTom Hughes <tom@compton.nu>
Sat, 24 Feb 2024 17:04:37 +0000 (17:04 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 24 Feb 2024 17:07:38 +0000 (17:07 +0000)
app/models/trace.rb

index be5d0a6318c0219c11c1c3499daaab3411cd86cd..1e8f25a830757b64f9cfa692d6fcaa6a74fce03b 100644 (file)
@@ -268,7 +268,7 @@ class Trace < ApplicationRecord
   end
 
   def schedule_import
-    TraceImporterJob.perform_later(self)
+    TraceImporterJob.new(self).enqueue(:priority => user.traces.where(:inserted => false).count)
   end
 
   def schedule_destruction