Skip to content

Commit c4be8f4

Browse files
committed
Fix blockless multi usage
1 parent 7587668 commit c4be8f4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/redis/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def call(command)
131131
reply = process([command]) { read }
132132
raise reply if reply.is_a?(CommandError)
133133

134-
if block_given?
134+
if block_given? && reply != 'QUEUED'
135135
yield reply
136136
else
137137
reply

test/transactions_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def test_multi_discard
1010

1111
assert_equal "QUEUED", r.set("foo", "1")
1212
assert_equal "QUEUED", r.get("foo")
13+
assert_equal "QUEUED", r.zincrby("bar", 1, "baz") # Floatify
14+
assert_equal "QUEUED", r.hsetnx("plop", "foo", "bar") # Boolify
1315

1416
r.discard
1517

0 commit comments

Comments
 (0)