diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-05 09:06:37 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-05 09:06:37 +0000 |
commit | fa7a282502c253ad3203f28bb10eede8b3a3cd3e (patch) | |
tree | 8296662efb4a66943846c716c6456bc13dbd08aa | |
parent | 723ca7b440b1cf161d999aedcfadba8498adaa7c (diff) | |
download | rainbows-fa7a282502c253ad3203f28bb10eede8b3a3cd3e.tar.gz |
Avoid constantly nuking the method cache and raising repeated exceptions while our master process is shutting us down.
-rw-r--r-- | lib/rainbows.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb index fed0715..480f2d6 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -98,10 +98,12 @@ module Rainbows end def self.quit! - @alive = false - Rainbows::HttpParser.quit - @expire ||= Time.now + (@server.timeout * 2.0) - @server.class.const_get(:LISTENERS).map! { |s| s.close rescue nil }.clear + unless @expire + @alive = false + Rainbows::HttpParser.quit + @expire = Time.now + (@server.timeout * 2.0) + @server.class.const_get(:LISTENERS).map! { |s| s.close rescue nil }.clear + end false end |