diff --git a/app/controllers/projects/wiki_controller.rb b/app/controllers/projects/wiki_controller.rb index 2c80f2895..30a78d38c 100644 --- a/app/controllers/projects/wiki_controller.rb +++ b/app/controllers/projects/wiki_controller.rb @@ -255,7 +255,7 @@ class Projects::WikiController < Projects::BaseController unless @committer p = commit_message.merge({:name => current_user.uname, :email => current_user.email}) @committer = Gollum::Committer.new(@wiki, p) - GitHook.perform_later!(:notifications, :process, {:project_id => @project.id, :actor_name => @committer.actor.name, :commit_sha => @committer.commit}) + GitHook.perform_later!(:notification, :process, {:project_id => @project.id, :actor_name => @committer.actor.name, :commit_sha => @committer.commit}) end @committer end diff --git a/app/models/build_list.rb b/app/models/build_list.rb index efaa2337d..65202ee0e 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -132,7 +132,7 @@ class BuildList < ActiveRecord::Base update_attribute(:status, has_published == 0 ? BUILD_PUBLISH : FAILED_PUBLISH) return has_published == 0 end - later :publish, :loner => true, :queue => :clone_and_build + later :publish, :loner => true, :queue => :clone_build def can_publish? status == BuildServer::SUCCESS or status == FAILED_PUBLISH diff --git a/app/models/platform.rb b/app/models/platform.rb index bdc0c68e4..580def2c8 100644 --- a/app/models/platform.rb +++ b/app/models/platform.rb @@ -179,12 +179,12 @@ class Platform < ActiveRecord::Base end end end - later :build_all, :loner => true, :queue => :clone_and_build + later :build_all, :loner => true, :queue => :clone_build def destroy with_skip {super} # avoid cascade XML RPC requests end - later :destroy, :loner => true, :queue => :clone_and_build + later :destroy, :loner => true, :queue => :clone_build protected @@ -218,7 +218,7 @@ class Platform < ActiveRecord::Base raise "Failed to clone platform #{old_name} with code #{result}. Path: #{build_path(old_name)} to platform #{new_name}" end end - later :xml_rpc_clone, :loner => true, :queue => :clone_and_build + later :xml_rpc_clone, :loner => true, :queue => :clone_build def freeze_platform if released_changed? && released == true diff --git a/app/models/project.rb b/app/models/project.rb index 5ea3caea8..e6c40ddb5 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -255,7 +255,7 @@ class Project < ActiveRecord::Base dummy = Grit::Repo.new(path) rescue parent.git_repository.repo.fork_bare(path) now_write_hook end - later :fork_git_repo, :loner => true, :queue => :fork_import_hook + later :fork_git_repo, :loner => true, :queue => :fork_import def destroy_git_repo FileUtils.rm_rf path @@ -267,7 +267,7 @@ class Project < ActiveRecord::Base self.srpm = nil; save # clear srpm end end - later :import_attached_srpm, :loner => true, :queue => :fork_import_hook + later :import_attached_srpm, :loner => true, :queue => :fork_import def create_wiki if has_wiki && !FileTest.exist?(wiki_path) @@ -300,5 +300,5 @@ class Project < ActiveRecord::Base rescue Exception # FIXME end - later :write_hook, :loner => true, :queue => :fork_import_hook + later :write_hook, :loner => true, :queue => :hook end diff --git a/app/models/repository.rb b/app/models/repository.rb index e36d4cab1..57c741790 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -29,7 +29,7 @@ class Repository < ActiveRecord::Base from.projects.find_each {|p| self.projects << p} end end - later :clone_relations, :loner => true, :queue => :clone_and_build + later :clone_relations, :loner => true, :queue => :clone_build def full_clone(attrs = {}) base_clone(attrs).tap do |c| diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb index a7f53158a..f3e8d36bb 100644 --- a/config/initializers/resque.rb +++ b/config/initializers/resque.rb @@ -3,7 +3,7 @@ require 'resque/status_server' ::ResqueServer = ::Resque::Server # need for CanCan -Resque::Mailer.default_queue_name = 'notifications' +Resque::Mailer.default_queue_name = :notification Resque::Mailer.excluded_environments = [:test] unless Rails.env.test? diff --git a/config/production.pill b/config/production.pill index 53f3b273d..4be8c85d4 100644 --- a/config/production.pill +++ b/config/production.pill @@ -8,7 +8,7 @@ Bluepill.application(app_name, :log_file => "/srv/rosa_build/shared/log/bluepill app.process("resque") do |process| process.group = "resque" pid_path = File.join(app.working_dir, 'tmp', 'pids', 'resque.pid') - process.start_command = "bundle exec rake resque:work QUEUE=fork_import_hook PIDFILE=#{ pid_path } BACKGROUND=yes" + process.start_command = "bundle exec rake resque:work QUEUE=fork_import,hook,clone_build,notification PIDFILE=#{ pid_path } BACKGROUND=yes" process.pid_file = pid_path process.stop_command = "kill -QUIT {{PID}}" process.daemonize = true diff --git a/lib/recipes/resque.rb b/lib/recipes/resque.rb index ae98eb72d..ab0e6c0a2 100644 --- a/lib/recipes/resque.rb +++ b/lib/recipes/resque.rb @@ -24,7 +24,7 @@ Capistrano::Configuration.instance(:must_exist).load do end def start_workers - run "cd #{fetch :current_path} && COUNT=#{ workers_count } QUEUE=fork_import_hook,clone_and_build,notifications #{ rails_env } BACKGROUND=yes bundle exec rake resque:workers" + run "cd #{fetch :current_path} && COUNT=#{ workers_count } QUEUE=fork_import,hook,clone_build,notification #{ rails_env } BACKGROUND=yes bundle exec rake resque:workers" end end end diff --git a/lib/tasks/hook.rake b/lib/tasks/hook.rake index d19e7c0be..1b7e3d964 100644 --- a/lib/tasks/hook.rake +++ b/lib/tasks/hook.rake @@ -37,7 +37,7 @@ namespace :hook do # require 'resque' require './app/models/git_hook' PerformLater.config.enabled = true unless Rails.env.test? - GitHook.perform_later!(:fork_import_hook, :process, *args.to_hash.values) + GitHook.perform_later!(:hook, :process, *args.to_hash.values) end desc "remove git hook from all repos"