Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Chagnon committed Sep 4, 2020
1 parent d87871f commit bd6de9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/redis/distributed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def initialize(node_configs, options = {})
def node_for(key)
key = key_tag(key.to_s) || key.to_s
raise CannotDistribute, :watch if @watch_key && @watch_key != key
node = @ring.get_node(key)

@ring.get_node(key)
end

def nodes
Expand Down Expand Up @@ -818,6 +819,7 @@ def watch(*keys, &block)
# Forget about all watched keys.
def unwatch
raise CannotDistribute, :unwatch unless @watch_key

result = node_for(@watch_key).unwatch
@watch_key = nil
result
Expand All @@ -830,6 +832,7 @@ def pipelined
# Mark the start of a transaction block.
def multi(&block)
raise CannotDistribute, :multi unless @watch_key

result = node_for(@watch_key).multi(&block)
@watch_key = nil if block_given?
result
Expand All @@ -838,6 +841,7 @@ def multi(&block)
# Execute all commands issued after MULTI.
def exec
raise CannotDistribute, :exec unless @watch_key

result = node_for(@watch_key).exec
@watch_key = nil
result
Expand All @@ -846,6 +850,7 @@ def exec
# Discard all commands issued after MULTI.
def discard
raise CannotDistribute, :discard unless @watch_key

result = node_for(@watch_key).discard
@watch_key = nil
result
Expand Down

0 comments on commit bd6de9f

Please sign in to comment.