Skip to content

Instantly share code, notes, and snippets.

@tsmango
Created May 27, 2010 02:37
Show Gist options
  • Select an option

  • Save tsmango/415372 to your computer and use it in GitHub Desktop.

Select an option

Save tsmango/415372 to your computer and use it in GitHub Desktop.
...
# Restart Passenger
deploy.task :restart, :roles => :app do
...
# Restart the resque workers
run "cd #{current_path} && rake queue:restart_workers RAILS_ENV=production"
end
namespace :queue do
task :restart_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
system("rm /var/run/god/resque-1.8.0*.pid")
end
end
@kbighorse
Copy link

Awesome, that's what I was thinking. Many thanks again!

Kimball

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment