lib/toiler/actor/processor.rb in toiler-0.2.5 vs lib/toiler/actor/processor.rb in toiler-0.2.6
- old
+ new
@@ -76,11 +76,15 @@
def visibility_extender(queue_visibility, sqs_msg, body)
return unless auto_visibility_timeout?
interval = queue_visibility - 5
Concurrent::TimerTask.execute execution_interval: interval,
timeout_interval: interval do
- sqs_msg.visibility_timeout = queue_visibility
- yield sqs_msg, body if block_given?
+ begin
+ sqs_msg.visibility_timeout = queue_visibility
+ yield sqs_msg, body if block_given?
+ rescue StandardError => e
+ error "Processor #{queue} failed to extend visibility of message: #{e.message}\n#{e.backtrace.join("\n")}"
+ end
end
end
def get_body(sqs_msg)
if sqs_msg.is_a? Array