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

[8.x] Add a queue:prune-failed command #37696

Merged
merged 3 commits into from
Jun 16, 2021
Merged

Conversation

themsaid
Copy link
Member

This command removes stale records from the failed_jobs database table. You can pass an --hours option with the number of hours to retain jobs data

@netpok
Copy link
Contributor

netpok commented Jun 15, 2021

Shouldn't be better to show an error message and exit with a non-zero return code if the provider does not support pruning instead of silently failing?

@wouterrutgers
Copy link

wouterrutgers commented Jun 30, 2021

May I ask what the difference is with the queue:flush command? Except for the limit parameter, which is only available in 9.X.

But that would mean, as far as I can tell, that from 9.X onwards there are 2 commands which will do identical things. What am I missing 😜?

@themsaid
Copy link
Member Author

themsaid commented Jul 1, 2021

@wouter2203 flush removes everything while prune keeps the latest records.

@wouterrutgers
Copy link

@themsaid Ah, my bad, didn't notice the default of 24 hours to keep!

This was referenced Aug 20, 2021
@bryceandy
Copy link

2 commands which will do identical things

There was a PR before this where flush uses an age option:

php artisan queue:flush --age=30
// Failed jobs older than 30 days

php artisan queue:prune-failed --hours=30
// Failed jobs older than 30 hours

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.

None yet

5 participants