Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
reload updated forwardings in scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
freels committed Jan 14, 2011
1 parent b5f4f04 commit 961dc5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/gizzard/nameserver.rb
Expand Up @@ -108,6 +108,12 @@ def get_shards(ids)
ids.map {|id| with_retry { client.get_shard(id) } }
end

def reload_updated_forwardings
parallel_map all_clients do |c|
with_retry { c.reload_config }
end
end

def reload_config
parallel_map all_clients do |c|
with_retry { c.reload_config }
Expand Down
1 change: 1 addition & 0 deletions lib/gizzard/thrift.rb
Expand Up @@ -150,6 +150,7 @@ def printable(method_name, args, timestamp = false)
end

class Manager < GizzmoService
thrift_method :reload_updated_forwardings, void, :throws => exception(GizzardException)
thrift_method :reload_config, void, :throws => exception(GizzardException)
thrift_method :rebuild_schema, void, :throws => exception(GizzardException)

Expand Down
4 changes: 2 additions & 2 deletions lib/gizzard/transformation_scheduler.rb
Expand Up @@ -67,7 +67,7 @@ def apply!
end
end

nameserver.reload_config
nameserver.reload_updated_forwardings

log "#{@jobs_finished.length} transformation#{'s' if @jobs_finished.length > 1} applied. Total time elapsed: #{time_elapsed}"
end
Expand Down Expand Up @@ -96,7 +96,7 @@ def schedule_jobs(num_to_schedule)
j.prepare!(nameserver)
end

nameserver.reload_config
nameserver.reload_updated_forwardings

copy_jobs = jobs.select {|j| j.copy_required? }

Expand Down

0 comments on commit 961dc5e

Please sign in to comment.