]> git.openstreetmap.org Git - rails.git/commitdiff
Use the trace jobs for creating and destroy traces via the API
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 27 Mar 2019 10:40:50 +0000 (11:40 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 27 Mar 2019 10:40:50 +0000 (11:40 +0100)
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