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
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