Skip to content

Commit 974e55d

Browse files
authored
Merge pull request #246 from tma/tma/keep-alive-fix
Ruby driver: Pass keep alive TTL/idle value correctly
2 parents 98a51a4 + 88f65d9 commit 974e55d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/redis_client/ruby_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def connect
169169
if %i[SOL_TCP SOL_SOCKET TCP_KEEPIDLE TCP_KEEPINTVL TCP_KEEPCNT].all? { |c| Socket.const_defined? c } # Linux
170170
def enable_socket_keep_alive(socket)
171171
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
172-
socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPIDLE, KEEP_ALIVE_INTERVAL)
172+
socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPIDLE, KEEP_ALIVE_TTL)
173173
socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPINTVL, KEEP_ALIVE_INTERVAL)
174174
socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPCNT, KEEP_ALIVE_PROBES)
175175
end

0 commit comments

Comments
 (0)