add default queue
This commit is contained in:
@@ -36,7 +36,7 @@ class TagAliasesController < ApplicationController
|
|||||||
def approve
|
def approve
|
||||||
@tag_alias = TagAlias.find(params[:id])
|
@tag_alias = TagAlias.find(params[:id])
|
||||||
@tag_alias.update_column(:status, "queued")
|
@tag_alias.update_column(:status, "queued")
|
||||||
@tag_alias.delay.process!
|
@tag_alias.delay(:queue => "default").process!
|
||||||
respond_with(@tag_alias, :location => tag_alias_path(@tag_alias))
|
respond_with(@tag_alias, :location => tag_alias_path(@tag_alias))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class TagImplicationsController < ApplicationController
|
|||||||
def approve
|
def approve
|
||||||
@tag_implication = TagImplication.find(params[:id])
|
@tag_implication = TagImplication.find(params[:id])
|
||||||
@tag_implication.update_column(:status, "queued")
|
@tag_implication.update_column(:status, "queued")
|
||||||
@tag_implication.delay.process!
|
@tag_implication.delay(:queue => "default").process!
|
||||||
respond_with(@tag_implication, :location => tag_implication_path(@tag_implication))
|
respond_with(@tag_implication, :location => tag_implication_path(@tag_implication))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ private
|
|||||||
case token[0]
|
case token[0]
|
||||||
when :create_alias
|
when :create_alias
|
||||||
tag_alias = TagAlias.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
|
tag_alias = TagAlias.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
|
||||||
tag_alias.delay.process!
|
tag_alias.delay(:queue => "default").process!
|
||||||
|
|
||||||
when :create_implication
|
when :create_implication
|
||||||
tag_implication = TagImplication.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
|
tag_implication = TagImplication.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
|
||||||
tag_implication.delay.process!
|
tag_implication.delay(:queue => "default").process!
|
||||||
|
|
||||||
when :remove_alias
|
when :remove_alias
|
||||||
tag_alias = TagAlias.where("antecedent_name = ?", token[1]).first
|
tag_alias = TagAlias.where("antecedent_name = ?", token[1]).first
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ class Artist < ActiveRecord::Base
|
|||||||
# potential race condition but unlikely
|
# potential race condition but unlikely
|
||||||
unless TagImplication.where(:antecedent_name => name, :consequent_name => "banned_artist").exists?
|
unless TagImplication.where(:antecedent_name => name, :consequent_name => "banned_artist").exists?
|
||||||
tag_implication = TagImplication.create(:antecedent_name => name, :consequent_name => "banned_artist")
|
tag_implication = TagImplication.create(:antecedent_name => name, :consequent_name => "banned_artist")
|
||||||
tag_implication.delay.process!
|
tag_implication.delay(:queue => "default").process!
|
||||||
end
|
end
|
||||||
|
|
||||||
update_column(:is_active, false)
|
update_column(:is_active, false)
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ class Tag < ActiveRecord::Base
|
|||||||
if post_count < 100
|
if post_count < 100
|
||||||
update_related
|
update_related
|
||||||
else
|
else
|
||||||
delay.update_related
|
delay(:queue => "default").update_related
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ end
|
|||||||
namespace :delayed_job do
|
namespace :delayed_job do
|
||||||
desc "Start delayed_job process"
|
desc "Start delayed_job process"
|
||||||
task :start, :roles => :app do
|
task :start, :roles => :app do
|
||||||
run "cd #{current_path}; RAILS_ENV=#{rails_env} bundle exec ruby script/delayed_job --queue=`hostname` start"
|
run "cd #{current_path}; RAILS_ENV=#{rails_env} bundle exec ruby script/delayed_job --queues=default,`hostname` start"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Stop delayed_job process"
|
desc "Stop delayed_job process"
|
||||||
|
|||||||
Reference in New Issue
Block a user