Skip to content
Snippets Groups Projects
Commit 5cd82384 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Use gitlab resque fork. Added rake task to stop all workers

parent 3b1519da
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -77,7 +77,7 @@ gem "acts-as-taggable-on", "2.3.3"
gem "draper", "~> 0.18.0"
 
# Background jobs
gem "resque", git: "https://github.com/defunkt/resque.git", ref: "9ef4700306dd946a3ac000612428967ce0c32213"
gem "resque", git: "https://github.com/gitlabhq/resque.git", ref: "9ef4700306dd946a3ac000612428967ce0c32213"
gem 'resque_mailer'
 
# HTTP requests
Loading
Loading
Loading
Loading
@@ -13,17 +13,6 @@ GIT
activerecord (>= 2.3.0)
rake (>= 0.8.7)
 
GIT
remote: https://github.com/defunkt/resque.git
revision: 9ef4700306dd946a3ac000612428967ce0c32213
ref: 9ef4700306dd946a3ac000612428967ce0c32213
specs:
resque (2.0.0.pre.1)
json
redis-namespace (~> 1.0)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
GIT
remote: https://github.com/gitlabhq/grack.git
revision: ba46f3b0845c6a09d488ae6abdce6ede37e227e8
Loading
Loading
@@ -70,6 +59,17 @@ GIT
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
 
GIT
remote: https://github.com/gitlabhq/resque.git
revision: 9ef4700306dd946a3ac000612428967ce0c32213
ref: 9ef4700306dd946a3ac000612428967ce0c32213
specs:
resque (2.0.0.pre.1)
json
redis-namespace (~> 1.0)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
GIT
remote: https://github.com/gitlabhq/yaml_db.git
revision: 98e9a5dca43e3fedd3268c76a73af40d1bdf1dfd
Loading
Loading
require 'resque/tasks'
 
task "resque:setup" => :environment do
Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
namespace :resque do
task setup: :environment do
Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
end
desc "Resque | kill all workers (using -QUIT), god will take care of them"
task :stop_workers => :environment do
pids = Array.new
Resque.workers.each do |worker|
pids << worker.to_s.split(/:/).second
end
if pids.size > 0
system("kill -QUIT #{pids.join(' ')}")
end
end
end
 
desc "Alias for resque:work (To run workers on Heroku)"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment