From 7fd1927d459260ebbdd8c7b0cab3ce376284624d Mon Sep 17 00:00:00 2001 From: mhenrixon Date: Thu, 11 Jun 2020 18:13:09 +0200 Subject: [PATCH] Don't loop indefinitely Close #515 --- lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb b/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb index 70c8e1a2e..a53af03af 100644 --- a/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb +++ b/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb @@ -157,6 +157,8 @@ def entries(conn, queue) # rubocop:disable Metrics/MethodLength entries = conn.lrange(queue_key, range_start, range_end) page += 1 + break if entries.empty? + entries.each do |entry| yield entry end