]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/traces_controller.rb
Use the trace jobs for creating and destroy traces via the API
[rails.git] / app / controllers / api / traces_controller.rb
index 47dd152a3fa6bc53bb38e8929865789fc37074a4..5e95892e1b01924c30d219a421b0c7677a9452a0 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