Add a configuration flag for using the job queue to import traces

This will allow the code to be merged to master, even if osm.org
isn't ready to start using it yet.
This commit is contained in:
Andy Allan 2019-01-16 11:13:55 +01:00
parent e59f1b6108
commit 581eca3bbe
2 changed files with 6 additions and 2 deletions

View file

@ -127,7 +127,7 @@ class TracesController < ApplicationController
flash[:notice] = t ".trace_uploaded"
flash[:warning] = t ".traces_waiting", :count => current_user.traces.where(:inserted => false).count if current_user.traces.where(:inserted => false).count > 4
TraceImporterJob.perform_later(@trace)
TraceImporterJob.perform_later(@trace) if TRACE_USE_JOB_QUEUE
redirect_to :action => :index, :display_name => current_user.display_name
else
flash[:error] = t("traces.create.upload_failed") if @trace.valid?
@ -211,7 +211,7 @@ class TracesController < ApplicationController
trace.visible = false
trace.save
flash[:notice] = t ".scheduled_for_deletion"
TraceDestroyerJob.perform_later(trace)
TraceDestroyerJob.perform_later(trace) if TRACE_USE_JOB_QUEUE
redirect_to :action => :index, :display_name => trace.user.display_name
end
rescue ActiveRecord::RecordNotFound