From 7e0dc42f7084e1719456a80b2e44049133c2e8b7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 20 Dec 2010 00:54:17 +0000 Subject: thread_timeout: fix bad comparison 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 --- lib/rainbows/thread_timeout.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/thread_timeout.rb') 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 -- cgit v1.2.3-24-ge0c7