laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.87k stars 658 forks source link

Prevent infinite loop when forgetting failed jobs #1429

Closed jackwh closed 7 months ago

jackwh commented 7 months ago

PR #1409 added an --all flag to delete all failed jobs.

When testing this with my application, for whatever reason $repository->totalFailed() didn't match the count of $repository->getFailed(). This caused an infinite loop, which is fixed by this PR.