]> git.openstreetmap.org Git - rails.git/blobdiff - lib/daemons/gpx_import.rb
translating the listing of diary entries. Adding some initial tests for checking...
[rails.git] / lib / daemons / gpx_import.rb
index 07f4cd6a4c4e8fade28e1cf9c0aec65198d389f4..e24dc1ad5347e43b141ad9f69131a7ad53a852cc 100755 (executable)
@@ -23,14 +23,14 @@ while(true) do
       if gpx.actual_points > 0
         Notifier::deliver_gpx_success(trace, gpx.actual_points)
       else
       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?')
         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 }
       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"))
       Notifier::deliver_gpx_failure(trace, ex.to_s + "\n" + ex.backtrace.join("\n"))
+      trace.destroy
     end
 
     Signal.trap("TERM", "DEFAULT")
     end
 
     Signal.trap("TERM", "DEFAULT")