- Set a global when we do LogStash::Agent#stop so we can skip steps like

reconnections, etc.
This commit is contained in:
Jordan Sissel 2010-12-23 03:03:11 -08:00
parent 1227c0b624
commit b00cbd8805
2 changed files with 7 additions and 0 deletions

View file

@ -106,6 +106,7 @@ class LogStash::Agent
# TODO(sissel): Stop inputs, fluch outputs, wait for finish,
# then stop the event loop
EventMachine.stop_event_loop
$EVENTMACHINE_STOPPING = true
end
protected

View file

@ -25,6 +25,12 @@ class LogStash::Stomp
end # def connection_completed
def unbind
if $EVENTMACHINE_STOPPING
@logger.debug(["Connection to stomp broker died (probably since we are exiting)",
{ :url => @url }])
return
end
@logger.error(["Connection to stomp broker died, retrying.", { :url => @url }])
@ready = false
EventMachine::Timer.new(1) do