Skip to content

Commit 1957f57

Browse files
yokonaorosa
authored andcommitted
SolidQueue::ClaimedExecution.fail_all_with return early when the record is empty
1 parent e20d376 commit 1957f57

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/models/solid_queue/claimed_execution.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ def release_all
3737
end
3838

3939
def fail_all_with(error)
40-
SolidQueue.instrument(:fail_many_claimed) do |payload|
41-
includes(:job).tap do |executions|
40+
includes(:job).tap do |executions|
41+
return if executions.empty?
42+
43+
SolidQueue.instrument(:fail_many_claimed) do |payload|
4244
executions.each do |execution|
4345
execution.failed_with(error)
4446
execution.unblock_next_job

0 commit comments

Comments
 (0)