diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-19 01:12:37 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-08-19 01:12:37 -0700 |
commit | ef3ce3c839a61acbb6ac0c138e4a90d449163cf8 (patch) | |
tree | f58accd39b2ad2d6970ca3844aa16e672e15a861 /lib | |
parent | ec0756d85d3518c60a8f1b76af43c672814d1c99 (diff) | |
download | unicorn-ef3ce3c839a61acbb6ac0c138e4a90d449163cf8.tar.gz |
While gettimeofday() isn't even a syscall on modern x86_64 Linux machines; Time objects aren't cheap. So avoid using time entirely as a fchmod argument and stick with 0s and 1s.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn/rainbows.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn/rainbows.rb b/lib/unicorn/rainbows.rb index 0f33db7..21ec43b 100644 --- a/lib/unicorn/rainbows.rb +++ b/lib/unicorn/rainbows.rb @@ -85,11 +85,12 @@ module Unicorn end end + nr = 0 begin Actor.sleep 1 clients.delete_if { |a| a.dead? } if alive - alive.chmod(Time.now.to_i) + alive.chmod(nr = 0 == nr ? 1 : 0) ppid == Process.ppid or alive = false end end while alive || ! clients.empty? |