Skip to content

Commit

Permalink
chore: refactor for understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Cardenas committed Sep 11, 2020
1 parent b571ca6 commit f5baec8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/redis.rb
Expand Up @@ -2438,13 +2438,13 @@ def unwatch
end

def pipelined
synchronize do |client|
synchronize do |prior_client|
begin
@client = Pipeline.new(client)
@client = Pipeline.new(prior_client)
yield(self)
client.call_pipeline(@client)
prior_client.call_pipeline(@client)
ensure
@client = client
@client = prior_client
end
end
end
Expand Down Expand Up @@ -2480,16 +2480,16 @@ def pipelined
# @see #watch
# @see #unwatch
def multi
synchronize do |client|
synchronize do |prior_client|
if !block_given?
client.call([:multi])
prior_client.call([:multi])
else
begin
@client = Pipeline::Multi.new(client)
@client = Pipeline::Multi.new(prior_client)
yield(self)
client.call_pipeline(@client)
prior_client.call_pipeline(@client)
ensure
@client = client
@client = prior_client
end
end
end
Expand Down

0 comments on commit f5baec8

Please sign in to comment.