about summary refs log tree commit homepage
path: root/lib/mogilefs/new_file/common.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-05-27 21:59:31 +0000
committerEric Wong <e@80x24.org>2015-05-27 21:59:31 +0000
commit5429893629154e39e0db33f5c98e237b29c7bbdc (patch)
tree9d6bc5f45869e3b433e0425e3f56656c8813e647 /lib/mogilefs/new_file/common.rb
parent44dd54e3c3ae6a771baa17935ebe09ece1616026 (diff)
downloadmogilefs-client-5429893629154e39e0db33f5c98e237b29c7bbdc.tar.gz
The monotonic clock is immune to discontinuous time jumps while
still taking into account clock imperfections, making it appropriate
for calculating time differences and timeouts.
Diffstat (limited to 'lib/mogilefs/new_file/common.rb')
-rw-r--r--lib/mogilefs/new_file/common.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/new_file/common.rb b/lib/mogilefs/new_file/common.rb
index b901f67..c102901 100644
--- a/lib/mogilefs/new_file/common.rb
+++ b/lib/mogilefs/new_file/common.rb
@@ -20,7 +20,7 @@ module MogileFS::NewFile::Common
 
   def read_response(sock)
     tout = @opts[:new_file_max_time] || 3600.0
-    start_time = @opts[:start_time] and tout -= Time.now - start_time
+    start_time = @opts[:start_time] and tout -= MogileFS.now - start_time
     set_socket_options(sock)
     case line = sock.timed_read(23, "", tout > 0.0 ? tout : 0)
     when %r{^HTTP/\d\.\d\s+(2\d\d)\s} # success!