From 9a2b4314fa071bb2b11797208cea2b0a7538cae5 Mon Sep 17 00:00:00 2001 From: cuzik Date: Thu, 21 Sep 2023 08:30:32 -0300 Subject: [PATCH] fix: following what #806 did to the 7.1 --- lib/sidekiq_unique_jobs/lock/while_executing.rb | 1 + spec/sidekiq_unique_jobs/lock/while_executing_spec.rb | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/sidekiq_unique_jobs/lock/while_executing.rb b/lib/sidekiq_unique_jobs/lock/while_executing.rb index a7affb689..0aecf9a32 100644 --- a/lib/sidekiq_unique_jobs/lock/while_executing.rb +++ b/lib/sidekiq_unique_jobs/lock/while_executing.rb @@ -42,6 +42,7 @@ def execute(&block) with_logging_context do executed = locksmith.execute do yield + item[JID] ensure unlock_and_callback end diff --git a/spec/sidekiq_unique_jobs/lock/while_executing_spec.rb b/spec/sidekiq_unique_jobs/lock/while_executing_spec.rb index ba5448127..07a1d1373 100644 --- a/spec/sidekiq_unique_jobs/lock/while_executing_spec.rb +++ b/spec/sidekiq_unique_jobs/lock/while_executing_spec.rb @@ -91,10 +91,12 @@ it "reflects execution_failed" do process_one.execute do - process_two.execute { puts "BOGUS!" } - # NOTE: Below looks weird but tests that - # the result from process_two (which is nil) isn't considered. - jid_one + process_two.execute do + puts "BOGUS!" + nil + end + + nil end expect(process_one).not_to have_received(:reflect).with(:execution_failed, item_one)