From 6e74322ff128a8ebe6edda569119458474f67d8c Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Thu, 7 Jan 2021 12:50:52 +0100 Subject: [PATCH] use monotonic time for retry timeout check --- lib/suo/client/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/suo/client/base.rb b/lib/suo/client/base.rb index a886159..7fc87f7 100644 --- a/lib/suo/client/base.rb +++ b/lib/suo/client/base.rb @@ -132,10 +132,10 @@ module Suo end def retry_with_timeout - start = Time.now.to_f + start = Process.clock_gettime(Process::CLOCK_MONOTONIC) retry_count.times do - elapsed = Time.now.to_f - start + elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start break if elapsed >= options[:acquisition_timeout] synchronize do