Skip to content

Commit

Permalink
Insert the "root_znode" path before "master_redis_node_manager_lock" …
Browse files Browse the repository at this point in the history
…and expose via accessor
  • Loading branch information
Jonathan W. Zaleski committed Feb 13, 2013
1 parent 0e86dea commit 8c996d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/redis_failover/node_manager.rb
Expand Up @@ -459,6 +459,11 @@ def redis_nodes_path
"#{@root_znode}/nodes" "#{@root_znode}/nodes"
end end


# @return [String] root path for current node manager lock
def current_lock_path
"#{@root_znode}/master_redis_node_manager_lock"
end

# @return [String] the znode path used for performing manual failovers # @return [String] the znode path used for performing manual failovers
def manual_failover_path def manual_failover_path
ManualFailover.path(@root_znode) ManualFailover.path(@root_znode)
Expand Down Expand Up @@ -631,7 +636,7 @@ def node_from(node_string)


# Executes a block wrapped in a ZK exclusive lock. # Executes a block wrapped in a ZK exclusive lock.
def with_lock def with_lock
@zk_lock ||= @zk.locker('master_redis_node_manager_lock') @zk_lock ||= @zk.locker(current_lock_path)


begin begin
@zk_lock.lock!(true) @zk_lock.lock!(true)
Expand Down

0 comments on commit 8c996d0

Please sign in to comment.