Skip to content

Commit

Permalink
Avoid data corruption in #queue.
Browse files Browse the repository at this point in the history
Potential fix for redis#878.
  • Loading branch information
ioquatix committed Oct 28, 2019
1 parent 6b894f8 commit 82d81b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/redis.rb
Expand Up @@ -100,7 +100,9 @@ def call(*command)
# See http://redis.io/topics/pipelining for more details.
#
def queue(*command)
@queue[Thread.current.object_id] << command
synchronize do
@queue[Thread.current.object_id] << command
end
end

# Sends all commands in the queue.
Expand Down

0 comments on commit 82d81b6

Please sign in to comment.