Sha256: 719e6271ce6f812fc38d8c7f055123d8a6e164d545fc33f1920e4ef76d1839a1
Contents?: true
Size: 960 Bytes
Versions: 21
Compression:
Stored size: 960 Bytes
Contents
Capistrano::Configuration.instance(:must_exist).load do define_recipe :rolling_restart do # Define the rolling_restart task for mongrel namespace :mongrel do desc <<-DESC Do a rolling restart of mongrels, one app server at a time. DESC task :rolling_restart do find_servers(:roles => :app).each do |server| ENV['HOSTS'] = "#{server.host}:#{server.port}" nginx.stop puts "Waiting 10 seconds for mongrels to finish processing on #{ENV['HOSTS']}." sleep 10 mongrel.restart puts "Waiting 30 seconds for mongrels to come back up on #{ENV['HOSTS']}." sleep 30 nginx.start end end end # Use a rolling restart by default. Theoretically, if we're doing migrations we should be using deploy:long anyway namespace :deploy do task :restart do mongrel.rolling_restart end end end end
Version data entries
21 entries across 21 versions & 2 rubygems