From 0a10915fff80ff90bdef2a905dfdc589e815aefd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 18 Nov 2015 03:58:05 +0000 Subject: bump to unicorn 5.0.1, use monotonic clock The timeout (mis)feature in unicorn uses the monotonic clock if available. We must follow suit to avoid having our timeout functionality completely broken. --- lib/rainbows/coolio/client.rb | 2 +- lib/rainbows/coolio/heartbeat.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/coolio') diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb index ad827f6..cd22c22 100644 --- a/lib/rainbows/coolio/client.rb +++ b/lib/rainbows/coolio/client.rb @@ -154,7 +154,7 @@ class Rainbows::Coolio::Client < Coolio::IO # buf == :wait_readable unless enabled? enable - KATO[self] = Time.now + KATO[self] = Rainbows.now end else on_read(''.freeze) diff --git a/lib/rainbows/coolio/heartbeat.rb b/lib/rainbows/coolio/heartbeat.rb index 3ae9e16..fcfbb0f 100644 --- a/lib/rainbows/coolio/heartbeat.rb +++ b/lib/rainbows/coolio/heartbeat.rb @@ -13,7 +13,7 @@ class Rainbows::Coolio::Heartbeat < Coolio::TimerWatcher def on_timer if (ot = KEEPALIVE_TIMEOUT) >= 0 - ot = Time.now - ot + ot = Rainbows.now - ot KATO.delete_if { |client, time| time < ot and client.timeout? } end exit if (! Rainbows.tick && CONN.size <= 0) -- cgit v1.2.3-24-ge0c7