]> 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 88b6edc67903782a0e7b90d4a5d0aa269b8a30b2..49db41076661cfc5667a116f36e44ef2fb7c01e5 100644 (file)
@@ -5,7 +5,6 @@ module Api
     before_action :authorize_web
     before_action :set_locale
     before_action :authorize
-    before_action :api_deny_access_handler
 
     authorize_resource
 
@@ -45,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
@@ -85,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