]> git.openstreetmap.org Git - rails.git/blobdiff - lib/daemons/gpx_import.rb
Potlatch 0.7b: small bugfixes
[rails.git] / lib / daemons / gpx_import.rb
index 793fde94b8f54c4fe3cb5c000c53c1d72c4c0b4c..07f4cd6a4c4e8fade28e1cf9c0aec65198d389f4 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 and visible = 1').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
@@ -55,5 +55,5 @@ while(true) do
     exit if terminated
   end
 
-  sleep 5.minutes
+  sleep 5.minutes.value
 end