Skip to content

Commit

Permalink
Allow the SQS input plugin to shut down gracefully when no events hav…
Browse files Browse the repository at this point in the history
…e arrived in the queue. Fixes logstash-plugins#33
  • Loading branch information
danielpops committed Jun 5, 2017
1 parent 19cd881 commit e4a7628
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/logstash/inputs/sqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def handle_message(message)
def run(output_queue)
@logger.debug("Polling SQS queue", :polling_options => polling_options)

poller.before_request do |stats|
throw :stop_polling if stop?
end

run_with_backoff do
poller.poll(polling_options) do |messages, stats|
break if stop?
Expand Down

0 comments on commit e4a7628

Please sign in to comment.