laravel / horizon

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

Prevent infinite loop when forgetting failed jobs #1429

Closed JackWH closed 2 months ago

JackWH commented 2 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.