Skip to content

Instantly share code, notes, and snippets.

@sudara
Created May 15, 2009 09:54
Show Gist options
  • Save sudara/112147 to your computer and use it in GitHub Desktop.
Save sudara/112147 to your computer and use it in GitHub Desktop.
set :mongrel_base_port, 5000
set :mongrel_restart_delay, 30
set :mongrel_count, 2
namespace :mongrel do
task :restart, :roles => [:app], :except => {:mongrel => false} do
(mongrel_base_port..(mongrel_base_port+mongrel_count)).to_a.each do |port|
sudo "/usr/bin/monit restart mongrel_#{monit_group}_#{port}"
sleep mongrel_restart_delay
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment