mirror of
https://github.com/dkam/suo.git
synced 2025-01-29 07:42:43 +00:00
Merge pull request #15 from doits/monotonic_time
use monotonic time for retry timeout check
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user