Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Allow failed job providers to be countable #48177

Merged
merged 5 commits into from
Aug 25, 2023

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Aug 25, 2023

When trying to count the number of failed jobs, you have to retrieve all records into memory and do an in-memory count, e.g.,

$jobs = app(FailedJobProviderInterface::class)->all();

$totalFailedJobs = count($jobs);

For applications with thousands or millions of failed jobs...this is not ideal.

Making the 1st party drivers Countable without introducing a new method on the interface.

I've created a dedicated PR for the Dynamo DB driver, as I don't have a means to test it and am hoping someone from the community can help out: #48178


Side note: kinda liking leaning on the Countable interface here. Not sure if genius or illegal 🚔.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants