Performance: Job retries and error handling
MEDIUM IMPACT
This affects server-side job processing speed and resource usage, indirectly impacting user experience by delaying background tasks.
class MyJob < ApplicationJob retry_on StandardError, wait: :exponentially_longer, attempts: 5 def perform(*args) # job logic end end
class MyJob < ApplicationJob retry_on StandardError def perform(*args) # job logic end end
| Pattern | Job Re-enqueues | Server Load | Queue Delay | Verdict |
|---|---|---|---|---|
| Unlimited immediate retries | Many rapid re-enqueues | High CPU and memory spikes | Long delays for other jobs | [X] Bad |
| Limited retries with exponential backoff | Few spaced re-enqueues | Balanced resource use | Minimal queue delays | [OK] Good |