Skip to content

Commit 36bb96d

Browse files
committed
document pause and continue
1 parent 71eeb73 commit 36bb96d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

queues.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
- [Queue Priorities](#queue-priorities)
4040
- [Queue Workers and Deployment](#queue-workers-and-deployment)
4141
- [Job Expirations and Timeouts](#job-expirations-and-timeouts)
42+
- [Pausing and Resuming Queue Workers](#pausing-and-resuming-queue-workers)
4243
- [Supervisor Configuration](#supervisor-configuration)
4344
- [Dealing With Failed Jobs](#dealing-with-failed-jobs)
4445
- [Cleaning Up After Failed Jobs](#cleaning-up-after-failed-jobs)
@@ -2291,6 +2292,27 @@ The `retry_after` configuration option and the `--timeout` CLI option are differ
22912292
> [!WARNING]
22922293
> The `--timeout` value should always be at least several seconds shorter than your `retry_after` configuration value. This will ensure that a worker processing a frozen job is always terminated before the job is retried. If your `--timeout` option is longer than your `retry_after` configuration value, your jobs may be processed twice.
22932294
2295+
<a name="pausing-and-resuming-queue-workers"></a>
2296+
### Pausing and Resuming Queue Workers
2297+
2298+
Sometimes you may need to temporarily prevent a queue worker from processing new jobs without stopping the worker entirely. For example, you may want to pause job processing during system maintenance. Laravel provides the `queue:pause` and `queue:continue` Artisan commands to pause and resume queue workers.
2299+
2300+
To pause a specific queue, provide the queue connection name and the queue name:
2301+
2302+
```shell
2303+
php artisan queue:pause database:default
2304+
```
2305+
2306+
In this example, `database` is the queue connection name and `default` is the queue name. Once a queue is paused, any workers processing jobs from that queue will continue to finish their current job, but will not pick up any new jobs until the queue is resumed.
2307+
2308+
To resume processing jobs on a paused queue, use the `queue:continue` command:
2309+
2310+
```shell
2311+
php artisan queue:continue database:default
2312+
```
2313+
2314+
After resuming a queue, workers will begin processing new jobs from that queue immediately. Note that pausing a queue does not stop the worker process itself - it only prevents the worker from processing new jobs from the specified queue.
2315+
22942316
<a name="supervisor-configuration"></a>
22952317
## Supervisor Configuration
22962318

0 commit comments

Comments
 (0)