diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-11-06 19:45:17 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-11-06 19:45:17 -0800 |
commit | 1a9a718a3f9a5b582a4a339a9bb9249c2ca392d7 (patch) | |
tree | 0c95f2d8fc4de8542f7716832800614e1e7a8872 /lib/rainbows/rev/heartbeat.rb | |
parent | e1dcadef6ca242e36e99aab19e3e040bf01070f9 (diff) | |
download | rainbows-1a9a718a3f9a5b582a4a339a9bb9249c2ca392d7.tar.gz |
It turns out neither the EventMachine and Rev classes checked for master death in its heartbeat mechanism. Since we managed to forget the same thing twice, we now have a test case for it and also centralized the code to remove duplication.
Diffstat (limited to 'lib/rainbows/rev/heartbeat.rb')
-rw-r--r-- | lib/rainbows/rev/heartbeat.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/rainbows/rev/heartbeat.rb b/lib/rainbows/rev/heartbeat.rb index 755b136..63eb71d 100644 --- a/lib/rainbows/rev/heartbeat.rb +++ b/lib/rainbows/rev/heartbeat.rb @@ -11,15 +11,9 @@ module Rainbows # will also detect and execute the graceful exit if triggered # by SIGQUIT class Heartbeat < ::Rev::TimerWatcher - # +tmp+ must be a +File+ that responds to +chmod+ - def initialize(tmp) - @m, @tmp = 0, tmp - super(1, true) - end def on_timer - @tmp.chmod(@m = 0 == @m ? 1 : 0) - exit if (! G.alive && G.cur <= 0) + exit if (! G.tick && G.cur <= 0) end end |