Skip to content
Snippets Groups Projects
Commit 47aead18 authored by Stan Hu's avatar Stan Hu
Browse files

Bump redis-rb to 3.3.1

parent e8a4dc70
No related branches found
No related tags found
1 merge request!72Bump redis-rb to 3.3.1
Pipeline #
REDIS_RB_VERSION=v3.3.0
REDIS_RB_VERSION=v3.3.1
REDIS_RB_VENDOR_DIR=lib/vendor/redis
PWD=`pwd`
 
Loading
Loading
Loading
Loading
@@ -10,6 +10,16 @@ rescue LoadError
# Not all systems have OpenSSL support
end
 
if RUBY_VERSION < "1.9.3"
class String
# Ruby 1.8.7 does not have byteslice, but it handles encodings differently anyway.
# We can simply slice the string, which is a byte array there.
def byteslice(*args)
slice(*args)
end
end
end
class Redis
module Connection
module SocketMixin
Loading
Loading
@@ -80,9 +90,34 @@ class Redis
raise Errno::ECONNRESET
end
 
# UNIXSocket and TCPSocket don't support write timeouts
def write(*args)
Timeout.timeout(@write_timeout, TimeoutError) { super }
def _write_to_socket(data)
begin
write_nonblock(data)
rescue *NBIO_EXCEPTIONS
if IO.select(nil, [self], nil, @write_timeout)
retry
else
raise Redis::TimeoutError
end
end
rescue EOFError
raise Errno::ECONNRESET
end
def write(data)
return super(data) unless @write_timeout
length = data.bytesize
total_count = 0
loop do
count = _write_to_socket(data)
total_count += count
return total_count if total_count >= length
data = data.byteslice(count..-1)
end
end
end
 
Loading
Loading
class Redis
VERSION = "3.3.0"
VERSION = "3.3.1"
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment