Skip to content

Commit 9c49947

Browse files
authored
Merge pull request #1175 from casperisfine/blocking-call-timeout
Add wait on blocking commands for an extra `config.read_timeout`
2 parents f78beb1 + d3efeeb commit 9c49947

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)