Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #52 from backupify/use_root_znode_in_lock_path

Insert the "root_znode" path before "master_redis_node_manager_lock" and expose via accessor
  • Loading branch information...
commit 2e51021e6daff253f936190e631bc66aca02e688 2 parents 0e86dea + 8c996d0
@ryanlecompte authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/redis_failover/node_manager.rb
View
7 lib/redis_failover/node_manager.rb
@@ -459,6 +459,11 @@ def redis_nodes_path
"#{@root_znode}/nodes"
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
def manual_failover_path
ManualFailover.path(@root_znode)
@@ -631,7 +636,7 @@ def node_from(node_string)
# Executes a block wrapped in a ZK exclusive lock.
def with_lock
- @zk_lock ||= @zk.locker('master_redis_node_manager_lock')
+ @zk_lock ||= @zk.locker(current_lock_path)
begin
@zk_lock.lock!(true)
Please sign in to comment.
Something went wrong with that request. Please try again.