Skip to content

Commit 4d9fe3c

Browse files
Change order of retries
1 parent b9251c7 commit 4d9fe3c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

app/workers/custom_styles/seed_remote_asset_job.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ class SeedRemoteAssetJob < ApplicationJob
4848
key: -> { "#{self.class.name}-#{arguments.first.id}" }
4949
)
5050

51-
retry_on GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError,
52-
wait: 5.seconds,
53-
attempts: :unlimited
54-
55-
# Retry transient HTTP failures a few times, after which we discard with a log entry.
51+
# ActiveJob matches retry_on/discard_on from bottom to top, so declare the
52+
# broad StandardError handler first and more specific handlers after it.
5653
retry_on StandardError, wait: :polynomially_longer, attempts: 5, report: true do |job, error|
5754
job.log_discard(error)
5855
end
5956

60-
# Declared after retry_on StandardError so they take precedence
57+
retry_on GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError,
58+
wait: 5.seconds,
59+
attempts: :unlimited
60+
6161
discard_on ActiveJob::DeserializationError do |job, error|
6262
job.log_discard(error)
6363
end

0 commit comments

Comments
 (0)