lib/memcache.rb in jsierles-memcache-client-1.5.0.5 vs lib/memcache.rb in jsierles-memcache-client-1.5.0.6

- old
+ new

@@ -16,11 +16,11 @@ class MemCache ## # The version of MemCache you are using. - VERSION = '1.5.0.5' + VERSION = '1.5.0.6' ## # Default options for the cache object. DEFAULT_OPTIONS = { @@ -660,10 +660,17 @@ # the server will be marked as down. CONNECT_TIMEOUT = 0.25 ## + # The amount of time to wait for a response from a memcached server. + # If a response isn't received within this time limit, + # the server will be marked as down. + + SOCKET_TIMEOUT = 0.25 + + ## # The amount of time to wait before attempting to re-establish a # connection with a server that is marked dead. RETRY_DELAY = 30.0 @@ -799,10 +806,10 @@ # TCPSocket facade class which implements timeouts. class TCPTimeoutSocket def initialize(*args) Timeout::timeout(MemCache::Server::CONNECT_TIMEOUT, SocketError) do @sock = TCPSocket.new(*args) - @len = ENV['MEMCACHE_SOCKET_TIMEOUT'].to_f || 0.5 + @len = MemCache::Server::SOCKET_TIMEOUT end end def write(*args) Timeout::timeout(@len, SocketError) do \ No newline at end of file