about summary refs log tree commit homepage
path: root/lib/rainbows/thread_timeout.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-20 00:54:17 +0000
committerEric Wong <normalperson@yhbt.net>2010-12-20 03:42:55 +0000
commit7e0dc42f7084e1719456a80b2e44049133c2e8b7 (patch)
treec9840f4eb56cc365664425b40b94978f43c40ed8 /lib/rainbows/thread_timeout.rb
parent886e0a006d9e8e9c586beae28ed4dc5097064e90 (diff)
downloadrainbows-7e0dc42f7084e1719456a80b2e44049133c2e8b7.tar.gz
This was causing unrelated requests to get killed every
+timeout+ seconds, instead of only the ones that were
running too long.

Noticed-by: ghazel@gmail.com
ref:
http://mid.gmane.org/AANLkTi=7OhyTwkHsp_rXU7Gp1PokihiQ9bJigpO-BfN6@mail.gmail.com
Diffstat (limited to 'lib/rainbows/thread_timeout.rb')
-rw-r--r--lib/rainbows/thread_timeout.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/thread_timeout.rb b/lib/rainbows/thread_timeout.rb
index b9f6025..18f400b 100644
--- a/lib/rainbows/thread_timeout.rb
+++ b/lib/rainbows/thread_timeout.rb
@@ -90,7 +90,7 @@ class Rainbows::ThreadTimeout
         now = Time.now
         @lock.synchronize do
           @active.delete_if do |thread, time|
-            time >= now and thread.raise(ExecutionExpired).nil?
+            now >= time and thread.raise(ExecutionExpired).nil?
           end
         end
       end while true