Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

workaround

  • Loading branch information...
commit 452e18f051435c758d9ede0f275f7cc5f2c0f176 1 parent 5201f48
@palvaro authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/bud/storage/zookeeper.rb
View
12 lib/bud/storage/zookeeper.rb
@@ -13,6 +13,7 @@ def initialize(name, zk_path, zk_addr, bud_instance)
end
super(name, bud_instance, [:key] => [:val, :opts])
+
@zk = Zookeeper.new(zk_addr)
zk_path = zk_path.chomp("/") unless zk_path == "/"
@@ -58,6 +59,17 @@ def start_watchers
end
end
+ EventMachine::PeriodicTimer.new(2) do
+ while true
+ break if @zk.closed?
+ if @zk_mutex.try_lock
+ get_and_watch unless @zk.closed?
+ @zk_mutex.unlock
+ break
+ end
+ end
+ end
+
stat_and_watch
end
Please sign in to comment.
Something went wrong with that request. Please try again.