Skip to content

Commit 4376756

Browse files
committed
Do not on final job retry failure
This way, a job that failed 5 times because of HTTP 5XX errors should not appear as failed job in SolidQueue.
1 parent 749f519 commit 4376756

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/jobs/application_job.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ class ApplicationJob < ActiveJob::Base
66
retry_on ActiveRecord::Deadlocked
77

88
# Retry on HTTP errors
9-
retry_on HTTPX::HTTPError, wait: HTTP_5XX_RETRY_DELAY
9+
retry_on(HTTPX::HTTPError, wait: HTTP_5XX_RETRY_DELAY) do |job, error|
10+
# Do not raise the error on the final retry
11+
end
1012

1113
# Most jobs are safe to ignore if the underlying records are no longer available
1214
discard_on ActiveJob::DeserializationError

0 commit comments

Comments
 (0)