diff options
author | Eric Wong <e@80x24.org> | 2015-11-18 03:58:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-11-21 01:43:29 +0000 |
commit | 0a10915fff80ff90bdef2a905dfdc589e815aefd (patch) | |
tree | 8692e5af9d367f57732dc985ba4c3d44af723fa6 /lib/rainbows/xepoll_thread_spawn/client.rb | |
parent | df169eb21fd571853bd388079d04e86a59298e9c (diff) | |
download | rainbows-0a10915fff80ff90bdef2a905dfdc589e815aefd.tar.gz |
The timeout (mis)feature in unicorn uses the monotonic clock if available. We must follow suit to avoid having our timeout functionality completely broken.
Diffstat (limited to 'lib/rainbows/xepoll_thread_spawn/client.rb')
-rw-r--r-- | lib/rainbows/xepoll_thread_spawn/client.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/xepoll_thread_spawn/client.rb b/lib/rainbows/xepoll_thread_spawn/client.rb index a3277cf..67c5976 100644 --- a/lib/rainbows/xepoll_thread_spawn/client.rb +++ b/lib/rainbows/xepoll_thread_spawn/client.rb @@ -35,7 +35,7 @@ module Rainbows::XEpollThreadSpawn::Client LOCK.synchronize { clients = KATO.keys; KATO.clear } clients.each { |io| io.closed? or io.shutdown } end - @@last_expire = Time.now + @@last_expire = Rainbows.now def kato_set LOCK.synchronize { KATO[self] = @@last_expire } @@ -59,7 +59,7 @@ module Rainbows::XEpollThreadSpawn::Client end def self.expire - return if ((now = Time.now) - @@last_expire) < 1.0 + return if ((now = Rainbows.now) - @@last_expire) < 1.0 if (ot = KEEPALIVE_TIMEOUT) >= 0 ot = now - ot defer = [] |