Skip to content

Commit 6d6d862

Browse files
committed
Unblock blocked job after failing claimed execution only in method called by supervisor
1 parent 6458dbf commit 6d6d862

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/models/solid_queue/claimed_execution.rb

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def release_all
3939
def fail_all_with(error)
4040
SolidQueue.instrument(:fail_many_claimed) do |payload|
4141
includes(:job).tap do |executions|
42-
executions.each { |execution| execution.failed_with(error) }
42+
executions.each do |execution|
43+
execution.failed_with(error)
44+
execution.unblock_next_job
45+
end
4346

4447
payload[:process_ids] = executions.map(&:process_id).uniq
4548
payload[:job_ids] = executions.map(&:job_id).uniq
@@ -67,7 +70,7 @@ def perform
6770
raise result.error
6871
end
6972
ensure
70-
job.unblock_next_blocked_job
73+
unblock_next_job
7174
end
7275

7376
def release
@@ -90,6 +93,10 @@ def failed_with(error)
9093
end
9194
end
9295

96+
def unblock_next_job
97+
job.unblock_next_blocked_job
98+
end
99+
93100
private
94101
def execute
95102
ActiveJob::Base.execute(job.arguments.merge("provider_job_id" => job.id))

0 commit comments

Comments
 (0)