]> git.openstreetmap.org Git - rails.git/blobdiff - lib/daemons/gpx_import.rb
Silly YAML and its subtly different parsers. This worked in Syck/LibYAML in Perl...
[rails.git] / lib / daemons / gpx_import.rb
index 86bd2ac143a43e36eb7867bc90b7da31ffefa672..e24dc1ad5347e43b141ad9f69131a7ad53a852cc 100755 (executable)
@@ -23,14 +23,14 @@ while(true) do
       if gpx.actual_points > 0
         Notifier::deliver_gpx_success(trace, gpx.actual_points)
       else
-        trace.destroy
         Notifier::deliver_gpx_failure(trace, '0 points parsed ok. Do they all have lat,lng,alt,timestamp?')
+        trace.destroy
       end
     rescue Exception => ex
       logger.info ex.to_s
       ex.backtrace.each {|l| logger.info l }
-      trace.destroy
       Notifier::deliver_gpx_failure(trace, ex.to_s + "\n" + ex.backtrace.join("\n"))
+      trace.destroy
     end
 
     Signal.trap("TERM", "DEFAULT")
@@ -55,5 +55,5 @@ while(true) do
     exit if terminated
   end
 
-  sleep 5.minutes
+  sleep 5.minutes.value
 end