diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-16 08:25:32 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-16 08:55:34 +0000 |
commit | f1d33c80dd6c5650f960f7087f4e08f809754d34 (patch) | |
tree | 2a4cb6193499e70990259bc00a2771b94566cd80 /lib | |
parent | 78ba3899eb24d6893e34984b9f1c479c7e6c9be3 (diff) | |
download | unicorn-f1d33c80dd6c5650f960f7087f4e08f809754d34.tar.gz |
In addition to SIGHUP, it should be possible to gradually bring workers back up (to avoid overloading the machine) when rolling back upgrades after SIGWINCH. Noticed-by: Lawrence Pit ref: http://mid.gmane.org/4C3F8C9F.2090903@gmail.com
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index c231a4d..8f490bb 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -423,10 +423,12 @@ module Unicorn respawn = false logger.info "gracefully stopping all workers" kill_each_worker(:QUIT) + self.worker_processes = 0 else logger.info "SIGWINCH ignored because we're not daemonized" end when :TTIN + respawn = true self.worker_processes += 1 when :TTOU self.worker_processes -= 1 if self.worker_processes > 0 |