Rename and separate queues. Refs #510
This commit is contained in:
parent
bcf4222282
commit
cb8345a207
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue