lib/berkshelf/api/cache_builder.rb in berkshelf-api-0.1.0 vs lib/berkshelf/api/cache_builder.rb in berkshelf-api-0.2.0
- old
+ new
@@ -17,18 +17,23 @@
@worker_registry = Celluloid::Registry.new
@worker_supervisor = WorkerSupervisor.new(@worker_registry)
@building = false
Application.config.endpoints.each do |endpoint|
- @worker_supervisor.supervise(CacheBuilder::Worker[endpoint.type], endpoint.options)
+ endpoint_options = endpoint.options.to_hash.deep_symbolize_keys
+ @worker_supervisor.supervise(CacheBuilder::Worker[endpoint.type], endpoint_options)
end
end
# Issue a single build command to all workers
#
# @return [Array]
def build
- workers.collect { |actor| actor.future(:build) }.map(&:value)
+ workers.collect { |actor| actor.future(:build) }.map do |f|
+ begin
+ f.value
+ rescue; end
+ end
end
# Issue a build command to all workers at the scheduled interval
#
# @param [Fixnum, Float] interval