mirror of
https://github.com/dkam/suo.git
synced 2025-01-29 07:42:43 +00:00
use monotonic time for retry timeout check
This commit is contained in:
@@ -132,10 +132,10 @@ module Suo
|
|||||||
end
|
end
|
||||||
|
|
||||||
def retry_with_timeout
|
def retry_with_timeout
|
||||||
start = Time.now.to_f
|
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||||
|
|
||||||
retry_count.times do
|
retry_count.times do
|
||||||
elapsed = Time.now.to_f - start
|
elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
|
||||||
break if elapsed >= options[:acquisition_timeout]
|
break if elapsed >= options[:acquisition_timeout]
|
||||||
|
|
||||||
synchronize do
|
synchronize do
|
||||||
|
|||||||
Reference in New Issue
Block a user