Performance: Failed job handling
MEDIUM IMPACT
This affects backend job processing speed and frontend responsiveness when jobs fail and retry.
public function failed(Exception $exception) {
// Notify admin and release job for retry with delay
Notification::route('mail', 'admin@example.com')->notify(new JobFailedNotification($exception));
$this->release(30); // retry after 30 seconds
}public function failed(Exception $exception) {
// Just log the error without any retry or alert
Log::error($exception->getMessage());
}| Pattern | Queue Load | Retries | User Impact | Verdict |
|---|---|---|---|---|
| No retry, no alert on failure | High - jobs pile up | None | Delays user interactions | [X] Bad |
| Retry with delay and admin alert | Low - controlled retries | Yes, delayed | Improves responsiveness | [OK] Good |