Navigation Menu

Skip to content

Commit

Permalink
Load catalog information correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 28, 2014
1 parent 370df07 commit b5c2679
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/droonga/command/serf_event_handler.rb
Expand Up @@ -98,6 +98,7 @@ def given_hosts

def join
type = @payload["type"]
puts "type = #{type}"
case type
when "replica"
join_as_replica
Expand All @@ -108,14 +109,17 @@ def join_as_replica
source = @payload["source"]
return unless source

puts "source = #{source}"

generator = create_current_catalog_generator
dataset = generator.dataset_for_host(source)
dataset = generator.dataset_for_host(source) ||
generator.dataset_for_host(host)
return unless dataset

dataset_name = dataset.name
tag = dataset.tag
port = dataset.port
other_hosts = dataset.hosts
tag = dataset.replicas.tag
port = dataset.replicas.port
other_hosts = dataset.replicas.hosts

puts "dataset = #{dataset_name}"
puts "port = #{port}"
Expand Down

0 comments on commit b5c2679

Please sign in to comment.