]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/traces_controller.rb
Fix queuing of trace imports for API uploads
[rails.git] / app / controllers / api / traces_controller.rb
index 47dd152a3fa6bc53bb38e8929865789fc37074a4..49db41076661cfc5667a116f36e44ef2fb7c01e5 100644 (file)
@@ -44,6 +44,7 @@ module Api
       if trace.user == current_user
         trace.visible = false
         trace.save!
+        TraceDestroyerJob.perform_later(trace) if Settings.trace_use_job_queue
 
         head :ok
       else
@@ -84,6 +85,7 @@ module Api
         trace = do_create(params[:file], tags, description, visibility)
 
         if trace.id
+          TraceImporterJob.perform_later(trace) if Settings.trace_use_job_queue
           render :plain => trace.id.to_s
         elsif trace.valid?
           head :internal_server_error