Skip to content

Commit

Permalink
fix: following what #806 did to the 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cuzik committed Sep 21, 2023
1 parent 36ffe8f commit 7b0f872
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/sidekiq_unique_jobs/lock/while_executing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def execute(&block)
with_logging_context do
executed = locksmith.execute do
yield
item[JID]
ensure
unlock_and_callback
end
Expand Down
10 changes: 6 additions & 4 deletions spec/sidekiq_unique_jobs/lock/while_executing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7b0f872

Please sign in to comment.