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

Add docs for new prune batches command #6693

Merged
merged 2 commits into from Dec 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions queues.md
Expand Up @@ -25,6 +25,7 @@
- [Inspecting Batches](#inspecting-batches)
- [Cancelling Batches](#cancelling-batches)
- [Batch Failures](#batch-failures)
- [Data Pruning](#batch-data-pruning)
- [Queueing Closures](#queueing-closures)
- [Running The Queue Worker](#running-the-queue-worker)
- [The `queue:work` Command](#the-queue-work-command)
Expand Down Expand Up @@ -1264,6 +1265,17 @@ For convenience, Laravel provides a `queue:retry-batch` Artisan command that all
php artisan queue:retry-batch 32dbc76c-4f82-4749-b610-a639fe0099b5
```

<a name="batch-data-pruning"></a>
### Data Pruning

Without pruning, the `job_batches` table can accumulate records very quickly. To mitigate this, you should [schedule](/docs/{{version}}/scheduling) the `queue:prune-batches` Artisan command to run daily:

$schedule->command('queue:prune-batches')->daily();

By default, all finished batches older than 24 hours will be pruned. You may use the `hours` option when calling the command to determine how long to retain batch data. For example, the following command will delete all batches finished over 48 hours ago:

$schedule->command('queue:prune-batches --hours=48')->daily();

<a name="queueing-closures"></a>
## Queueing Closures

Expand Down