From 6858c79a49a5d25edb6c06ffd131749eb2f23b2b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 22 Jun 2011 02:21:58 +0000 Subject: Unicorn 4.x resync for ticker This removes the extra per-process file descriptor and replaces it with Raindrops. --- lib/rainbows.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/rainbows.rb') 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 -- cgit v1.2.3-24-ge0c7