lib/toiler/actor/processor.rb in toiler-0.2.9 vs lib/toiler/actor/processor.rb in toiler-0.3.0
- old
+ new
@@ -73,10 +73,10 @@
fetcher.tell :processor_finished
end
def visibility_extender(queue_visibility, sqs_msg, body)
return unless auto_visibility_timeout?
- interval = queue_visibility - 5
+ interval = [1,queue_visibility/3].max
Concurrent::TimerTask.execute execution_interval: interval,
timeout_interval: interval do
begin
sqs_msg.visibility_timeout = queue_visibility
yield sqs_msg, body if block_given?