Skip to content

Commit a4bd748

Browse files
authored
fix: raise on error (#712)
* fix: remember raise for until_executing * chore: mandatory rubocop commit * chore: mandatory linter commit
1 parent b9a25f2 commit a4bd748

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.reek.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ detectors:
143143
- SidekiqUniqueJobs::Lock#lock
144144
- SidekiqUniqueJobs::Lock::BaseLock#call_strategy
145145
- SidekiqUniqueJobs::Lock::UntilAndWhileExecuting#execute
146+
- SidekiqUniqueJobs::Lock::UntilExecuting#execute
146147
- SidekiqUniqueJobs::Lock::WhileExecuting#execute
147148
- SidekiqUniqueJobs::LockArgs#filtered_args
148149
- SidekiqUniqueJobs::LockInfo#set

lib/sidekiq_unique_jobs/lock/until_executing.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def execute
3636
rescue StandardError => ex
3737
reflect(:execution_failed, item, ex)
3838
locksmith.lock(wait: 1)
39+
raise
3940
end
4041
end
4142
end

spec/sidekiq_unique_jobs/lock/until_executing_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,15 @@
4747

4848
it "locks the job again" do
4949
process_one.lock
50-
process_one.execute(&block)
50+
expect { process_one.execute(&block) }.to raise_error(RuntimeError, "Hell")
5151
expect(process_one).to be_locked
5252
end
5353

5454
it "reflects execution failed" do
5555
allow(process_one).to receive(:reflect)
5656

5757
process_one.lock
58-
process_one.execute(&block)
59-
58+
expect { process_one.execute(&block) }.to raise_error(RuntimeError, "Hell")
6059
expect(process_one).to have_received(:reflect)
6160
.with(:execution_failed, item_one, kind_of(RuntimeError))
6261
end

spec/sidekiq_unique_jobs/unlockable_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
specify do
4747
expect { push_item(item) }.to change { unique_keys.size }.by(3)
48-
expect { delete }.to change { unique_keys.size }.by(0)
48+
expect { delete }.not_to change { unique_keys.size }
4949
end
5050
end
5151

0 commit comments

Comments
 (0)