From 2a1ba810e93c9097728b69521513b367d5c51b89 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Mon, 27 Nov 2023 12:00:40 +0000 Subject: [PATCH] delete_message_batch failed is returning nil rather than empty array as before, default to empty array if nil returned --- lib/shoryuken/queue.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/shoryuken/queue.rb b/lib/shoryuken/queue.rb index 24a7aec2..3d62d371 100644 --- a/lib/shoryuken/queue.rb +++ b/lib/shoryuken/queue.rb @@ -21,9 +21,10 @@ def visibility_timeout end def delete_messages(options) - client.delete_message_batch( + failed_messages = client.delete_message_batch( options.merge(queue_url: url) - ).failed.any? do |failure| + ).failed || [] + failed_messages.any? do |failure| logger.error do "Could not delete #{failure.id}, code: '#{failure.code}', message: '#{failure.message}', sender_fault: #{failure.sender_fault}" end