about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/rainbows.rb5
-rw-r--r--lib/rainbows/base.rb2
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 64d2d03..ef9e75f 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -65,7 +65,7 @@ module Rainbows
     attr_accessor :server
     attr_accessor :cur # may not always be used
     attr_reader :alive
-    attr_writer :tick_io
+    attr_writer :worker
     attr_writer :forked
   end
 
@@ -78,7 +78,6 @@ module Rainbows
 
   @alive = true
   @cur = 0
-  @tick_mod = 0
   @expire = nil
   @at_quit = []
 
@@ -87,7 +86,7 @@ module Rainbows
   end
 
   def self.tick
-    @tick_io.chmod(@tick_mod = 0 == @tick_mod ? 1 : 0)
+    @worker.tick = Time.now.to_i
     exit!(2) if @expire && Time.now >= @expire
     @alive && @server.master_pid == Process.ppid or quit!
   end
diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb
index c2f7335..e614ccf 100644
--- a/lib/rainbows/base.rb
+++ b/lib/rainbows/base.rb
@@ -13,7 +13,7 @@ module Rainbows::Base
     super(worker)
     Rainbows::Response.setup(self.class)
     Rainbows::MaxBody.setup
-    Rainbows.tick_io = worker.tmp
+    Rainbows.worker = worker
 
     # we're don't use the self-pipe mechanism in the Rainbows! worker
     # since we don't defer reopening logs