Skip to content

Commit d3efeeb

Browse files
committed
Add wait on blocking commands for an extra config.read_timeout
Previously we were waiting an extra 100ms which is totally arbitrary and might not be enough.
1 parent f78beb1 commit d3efeeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/redis/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def call_v(command, &block)
7878
def blocking_call_v(timeout, command, &block)
7979
if timeout && timeout > 0
8080
# Can't use the command timeout argument as the connection timeout
81-
# otherwise it would be very racy. So we add an extra 100ms to account for
82-
# the network delay.
83-
timeout += 0.1
81+
# otherwise it would be very racy. So we add the regular read_timeout on top
82+
# to account for the network delay.
83+
timeout += config.read_timeout
8484
end
8585

8686
super(timeout, command, &block)

0 commit comments

Comments
 (0)