Skip to content
This repository has been archived by the owner on Feb 19, 2018. It is now read-only.

Commit

Permalink
Handle expired zookeeper sessions gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagen Rother committed Apr 5, 2013
1 parent f597ae2 commit 350972b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/druid/zoo_handler.rb
Expand Up @@ -11,6 +11,14 @@ def initialize(uri, opts = {})
@discovery_path = opts[:discovery_path] || '/discoveryPath' @discovery_path = opts[:discovery_path] || '/discoveryPath'
@watched_services = Hash.new @watched_services = Hash.new


init_zookeeper
end

def init_zookeeper
@zk.on_expired_session do
init_zookeeper
end

@zk.register(@discovery_path, :only => :child) do |event| @zk.register(@discovery_path, :only => :child) do |event|
check_services check_services
end end
Expand Down
2 changes: 1 addition & 1 deletion ruby-druid.gemspec
Expand Up @@ -2,7 +2,7 @@ require 'rake'


Gem::Specification.new do |gem| Gem::Specification.new do |gem|
gem.name = 'ruby-druid' gem.name = 'ruby-druid'
gem.version = '0.0.5' gem.version = '0.0.6'
gem.date = '2013-04-04' gem.date = '2013-04-04'
gem.summary = 'Ruby client for druid' gem.summary = 'Ruby client for druid'
gem.description = 'Ruby client for metamx druid' gem.description = 'Ruby client for metamx druid'
Expand Down

0 comments on commit 350972b

Please sign in to comment.