Skip to content

Commit

Permalink
Fix blockless multi usage
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 26, 2020
1 parent 7587668 commit c4be8f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/redis/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def call(command)
reply = process([command]) { read }
raise reply if reply.is_a?(CommandError)

if block_given?
if block_given? && reply != 'QUEUED'
yield reply
else
reply
Expand Down
2 changes: 2 additions & 0 deletions test/transactions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def test_multi_discard

assert_equal "QUEUED", r.set("foo", "1")
assert_equal "QUEUED", r.get("foo")
assert_equal "QUEUED", r.zincrby("bar", 1, "baz") # Floatify
assert_equal "QUEUED", r.hsetnx("plop", "foo", "bar") # Boolify

r.discard

Expand Down

0 comments on commit c4be8f4

Please sign in to comment.