add default queue

This commit is contained in:
albert
2013-03-03 01:21:00 -05:00
parent f0b29fc3ba
commit 89c0ab86a8
6 changed files with 7 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ class TagAliasesController < ApplicationController
def approve
@tag_alias = TagAlias.find(params[:id])
@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))
end

View File

@@ -27,7 +27,7 @@ class TagImplicationsController < ApplicationController
def approve
@tag_implication = TagImplication.find(params[:id])
@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))
end
end

View File

@@ -40,11 +40,11 @@ private
case token[0]
when :create_alias
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
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
tag_alias = TagAlias.where("antecedent_name = ?", token[1]).first

View File

@@ -181,7 +181,7 @@ class Artist < ActiveRecord::Base
# potential race condition but unlikely
unless TagImplication.where(:antecedent_name => name, :consequent_name => "banned_artist").exists?
tag_implication = TagImplication.create(:antecedent_name => name, :consequent_name => "banned_artist")
tag_implication.delay.process!
tag_implication.delay(:queue => "default").process!
end
update_column(:is_active, false)

View File

@@ -373,7 +373,7 @@ class Tag < ActiveRecord::Base
if post_count < 100
update_related
else
delay.update_related
delay(:queue => "default").update_related
end
end
end

View File

@@ -105,7 +105,7 @@ end
namespace :delayed_job do
desc "Start delayed_job process"
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
desc "Stop delayed_job process"