lib/sqs_buffer/client.rb in sqs_buffer-0.3.1 vs lib/sqs_buffer/client.rb in sqs_buffer-0.3.2
- old
+ new
@@ -29,15 +29,19 @@
def start_polling
@running.make_true
@worker_thread = Thread.new do
- opts = {
- skip_delete: @skip_delete,
- max_number_of_messages: @max_number_of_messages
- }
- @poller.poll(opts) do |messages|
- store_messages(messages)
+ begin
+ opts = {
+ skip_delete: @skip_delete,
+ max_number_of_messages: @max_number_of_messages
+ }
+ @poller.poll(opts) do |messages|
+ store_messages(messages)
+ end
+ rescue => e
+ @logger.error "A Fatal exception(#{e.message}) occurred in worker thread | Backtrace: #{e.backtrace}"
end
end # End worker thread
@running.value
end