lib/picky/interfaces/live_parameters.rb in picky-1.3.0 vs lib/picky/interfaces/live_parameters.rb in picky-1.3.1
- old
+ new
@@ -20,11 +20,11 @@
def start_master_process_thread
# This thread is stopped in the children.
#
Thread.new do
loop do
- sleep 1 # TODO select
+ IO.select([@child], nil, nil, 2) or next
result = @child.gets ';;;'
pid, configuration_hash = eval result
next unless Hash === configuration_hash
next if configuration_hash.empty?
exclaim "Trying to update MASTER configuration."
@@ -121,9 +121,11 @@
exclaim " Setting #{key} with #{new_value}."
current_key = key
send :"#{key}=", new_value
end
rescue StandardError => e
+ # Catch any error and reraise as config error.
+ #
raise CouldNotUpdateConfigurationError.new current_key, e.message
end
end
def extract_configuration
\ No newline at end of file