use monotonic time for retry timeout check

This commit is contained in:
Markus Doits
2021-01-07 12:50:52 +01:00
parent b9d3f1b7a1
commit 6e74322ff1

View File

@@ -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