Permalink
Browse files

rsp_forest: After updating local records of forest membership, send o…

…ut INTRODUCE requests to any trees not previously known.
  • Loading branch information...
Pistos
Pistos committed Jul 19, 2015
1 parent 2b2be76 commit 8c292585194ce1740e1811f0589104d0a8fd3cc3
Showing with 11 additions and 2 deletions.
  1. +11 −2 lib/libertree/server/responder/forest.rb
@@ -21,10 +21,19 @@ def rsp_forest(params)
)
end
trees = params['trees'].reject { |tree|
domains = params['trees'].reject { |tree|
tree['domain'] == Server.conf['domain']
}.map { |t|
t['domain']
}
forest.set_trees_by_domain trees.map {|t| t['domain']}
new_trees = forest.set_trees_by_domain(domains)
new_trees.each do |tree|
Libertree::Model::Job.create( {
task: 'request:INTRODUCE',
params: { 'host' => tree.domain, }.to_json,
} )
end
rescue LibertreeError => e
raise e
rescue => e

0 comments on commit 8c29258

Please sign in to comment.