about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-19 01:12:37 -0700
committerEric Wong <normalperson@yhbt.net>2009-08-19 01:12:37 -0700
commitef3ce3c839a61acbb6ac0c138e4a90d449163cf8 (patch)
treef58accd39b2ad2d6970ca3844aa16e672e15a861
parentec0756d85d3518c60a8f1b76af43c672814d1c99 (diff)
downloadunicorn-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.
-rw-r--r--lib/unicorn/rainbows.rb3
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?