]> git.openstreetmap.org Git - rails.git/blobdiff - lib/daemons/gpx_import.rb
Process traces in order.
[rails.git] / lib / daemons / gpx_import.rb
index e80a519446b283cd82b277712db1c09f15551694..86bd2ac143a43e36eb7867bc90b7da31ffefa672 100755 (executable)
@@ -12,7 +12,7 @@ logger = ActiveRecord::Base.logger
 while(true) do
   ActiveRecord::Base.logger.info("GPX Import daemon wake @ #{Time.now}.")
 
-  Trace.find(:all, :conditions => 'inserted = 0').each do |trace|
+  Trace.find(:all, :conditions => "inserted = 0 and visible = 1", :order => "id").each do |trace|
     Signal.trap("TERM") do 
       terminated = true
     end
@@ -38,7 +38,7 @@ while(true) do
     exit if terminated
   end
 
-  Trace.find(:all, :conditions => 'visible = 0').each do |trace|
+  Trace.find(:all, :conditions => "visible = 0", :order => "id").each do |trace|
     Signal.trap("TERM") do 
       terminated = true
     end