about summary refs log tree commit homepage
path: root/lib/rainbows/fiber/base.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-18 03:58:05 +0000
committerEric Wong <e@80x24.org>2015-11-21 01:43:29 +0000
commit0a10915fff80ff90bdef2a905dfdc589e815aefd (patch)
tree8692e5af9d367f57732dc985ba4c3d44af723fa6 /lib/rainbows/fiber/base.rb
parentdf169eb21fd571853bd388079d04e86a59298e9c (diff)
downloadrainbows-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/fiber/base.rb')
-rw-r--r--lib/rainbows/fiber/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/fiber/base.rb b/lib/rainbows/fiber/base.rb
index e8f5b16..7c4fb59 100644
--- a/lib/rainbows/fiber/base.rb
+++ b/lib/rainbows/fiber/base.rb
@@ -40,7 +40,7 @@ module Rainbows::Fiber::Base
   # woken and returns an interval to IO.select on
   def schedule_sleepers
     max = nil
-    now = Time.now
+    now = Rainbows.now
     fibs = []
     ZZ.delete_if { |fib, time|
       if now >= time
@@ -54,7 +54,7 @@ module Rainbows::Fiber::Base
 
     max_sleep = 1.0 # wake up semi-frequently to prevent SIGKILL from master
     if max
-      max -= Time.now
+      max -= Rainbows.now
       return 0 if max < 0.0
       return max_sleep if max > max_sleep
       max