Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/redis_client/ruby_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def connect
socket = if @config.path
UNIXSocket.new(@config.path)
else
sock = if SUPPORTS_RESOLV_TIMEOUT
socket = if SUPPORTS_RESOLV_TIMEOUT
begin
Socket.tcp(@config.host, @config.port, connect_timeout: @connect_timeout, resolv_timeout: @connect_timeout)
rescue Errno::ETIMEDOUT => timeout_error
Expand All @@ -128,9 +128,9 @@ def connect
Socket.tcp(@config.host, @config.port, connect_timeout: @connect_timeout)
end
# disables Nagle's Algorithm, prevents multiple round trips with MULTI
sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
enable_socket_keep_alive(sock)
sock
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
enable_socket_keep_alive(socket)
socket
end

if @config.ssl
Expand Down
Loading