lib/rflow/shard.rb in rflow-1.0.0a4 vs lib/rflow/shard.rb in rflow-1.0.0a5
- old
+ new
@@ -29,10 +29,11 @@
# TODO: need to do proper node synchronization for ZMQ to remove sleep
sleep 1
run_components!
rescue Exception => e
RFlow.logger.error "Error in worker, shutting down: #{e.class.name}: #{e.message}, because: #{e.backtrace.inspect}"
+ exit! 1
end
end
RFlow.logger.info "Shutting down worker after EM stopped"
end
@@ -66,9 +67,14 @@
component.run!
end
end
def shutdown!(signal)
+ RFlow.logger.debug "Shutting down components"
+ @components.each do |component|
+ RFlow.logger.debug "Shutting down component '#{component.name}' (#{component.uuid})"
+ component.shutdown!
+ end
EM.stop_event_loop
super
end
end