about summary refs log tree commit homepage
path: root/lib/rainbows.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-05 09:06:37 +0000
committerEric Wong <normalperson@yhbt.net>2011-02-05 09:06:37 +0000
commitfa7a282502c253ad3203f28bb10eede8b3a3cd3e (patch)
tree8296662efb4a66943846c716c6456bc13dbd08aa /lib/rainbows.rb
parent723ca7b440b1cf161d999aedcfadba8498adaa7c (diff)
downloadrainbows-fa7a282502c253ad3203f28bb10eede8b3a3cd3e.tar.gz
Avoid constantly nuking the method cache and raising
repeated exceptions while our master process is shutting
us down.
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb10
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