Pause All Laravel Queues During a Deploy | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. Pause All Laravel Queues During a Deploy with queue:pause --all

   [Laravel](https://www.msaied.com/public/articles?category=laravel) [Tips &amp; Tricks](https://www.msaied.com/public/articles?category=tips-tricks) 

 Pause All Laravel Queues During a Deploy with queue:pause --all
================================================================

 Laravel 13.25 adds a global queue pause switch that stops every worker on every connection from reserving new jobs during a deploy, without touching HTTP traffic or interrupting in-flight work.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 13 Aug 2026 · Updated 13 Aug 2026 · 3 min read

ShareCopy linkCopied

 ![Pause All Laravel Queues During a Deploy with queue:pause --all](https://cdn.msaied.com/544/c20621d0362f00ab3b40c840c3e90f27.png) 

  On this page +1. [The Deploy Race Condition Every Laravel Developer Knows](#the-deploy-race-condition-every-laravel-developer-knows)
2. [The Commands](#the-commands)
3. [What Pausing Actually Does](#what-pausing-actually-does)
4. [Individual and Global Pauses Are Independent](#individual-and-global-pauses-are-independent)
5. [Events](#events)
6. [Key Takeaways](#key-takeaways)

 The Deploy Race Condition Every Laravel Developer Knows
-------------------------------------------------------

There is a brief window during most deploys where new code is on disk but queue workers have not restarted yet. A worker that picks up a job in that window deserializes a payload written by the old code and runs it through the new code. Usually nothing breaks. Occasionally a renamed job class or a changed constructor signature produces a failed job you have to replay by hand.

The traditional fixes each have drawbacks:

- **Maintenance mode** stops HTTP traffic too, which is often more than you want.
- **`queue:restart`** is a polite request, not a guarantee — a worker only sees it between jobs.

Laravel 13.25 adds a third option: a global pause switch that stops every worker on every connection from reserving new work, while leaving HTTP traffic completely unaffected.

The Commands
------------

```bash
# Pause all queues before deploying
php artisan queue:pause --all

# Resume after the deploy is complete
php artisan queue:resume --all

```

The queue argument is now optional on both commands. Without `--all` they behave as before and accept a `connection:queue` pair.

The same functionality is available on the `Queue` facade for deploy scripts written in PHP or for an admin panel controller:

```php
use Illuminate\Support\Facades\Queue;

Queue::pauseAll();

// run your deploy steps here

Queue::resumeAll();

```

What Pausing Actually Does
--------------------------

Pausing stops workers from **reserving** new jobs. The worker process stays alive and keeps looping — it just sleeps instead of popping from the queue. A job already being processed when you pause runs to completion, so `queue:pause --all` will not interrupt anything mid-flight.

Producers are unaffected: `SomeJob::dispatch()` continues writing to Redis or the database, and those jobs wait there until you resume.

Under the hood, the feature writes a single cache key — `illuminate:queues:paused` — using `forever()`. Workers already read the cache once per loop to check for restart and per-queue pause signals, and the global key is fetched in the same `many()` call, so there are no extra round trips.

Individual and Global Pauses Are Independent
--------------------------------------------

`pause()` and `pauseAll()` write different cache keys and are deliberately unaware of each other. If a queue was paused individually before the deploy, `resumeAll()` leaves it paused:

```php
Queue::pause('redis', 'imports');    // parked earlier to investigate a bad job

Queue::pauseAll();                   // deploy starts
Queue::resumeAll();                  // deploy finishes

Queue::isPaused('redis', 'imports'); // still true

```

This is exactly the behavior you want. Someone parked the `imports` queue on purpose an hour ago, and a deploy running `resumeAll()` should not silently undo that. Clearing an individual pause still requires `queue:resume redis:imports`.

Events
------

Two new events fire alongside the existing per-queue `QueuePaused` and `QueueResumed`:

```php
use Illuminate\Queue\Events\QueuesPaused;
use Illuminate\Queue\Events\QueuesResumed;

Event::listen(function (QueuesPaused $event) {
    Log::warning('All queues paused — deploy in progress');
});

```

These are useful for alerting, audit logs, or triggering external monitoring integrations.

Key Takeaways
-------------

- `php artisan queue:pause --all` and `Queue::pauseAll()` are new in Laravel 13.25.
- Workers stay alive but stop reserving jobs; in-flight jobs finish normally.
- Producers keep dispatching; jobs accumulate and are processed after `resumeAll()`.
- Global and per-queue pauses are independent — `resumeAll()` does not clear individual pauses.
- The feature is implemented as a single cache key with no extra round trips per worker loop.
- Contributed by Jack Bayliss in [PR #61126](https://github.com/laravel/framework/pull/61126).

---

*Source: [Pause All Laravel Queues During a Deploy — Laravel News](https://laravel-news.com/laravel-pause-all-queues)*

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [Queues](https://www.msaied.com/public/articles?search=Queues)
- [Deployment](https://www.msaied.com/public/articles?search=Deployment)
- [Laravel 13](https://www.msaied.com/public/articles?search=Laravel%2013)
- [PHP](https://www.msaied.com/public/articles?search=PHP)

 Frequently asked questions 
---------------------------

  Does queue:pause --all interrupt jobs that are already running?No. Pausing stops workers from reserving new jobs, but any job already being processed when the pause is issued runs to completion. Only new reservations are blocked.

   Will queue:resume --all unpause a queue that was individually paused before the deploy?No. Global and per-queue pauses are independent. If a queue was paused individually with Queue::pause() or queue:pause, resumeAll() leaves it paused. You must run queue:resume connection:queue explicitly to clear an individual pause.

   Do dispatched jobs get lost while all queues are paused?No. Producers are unaffected by the pause. Jobs dispatched with SomeJob::dispatch() are written to Redis or the database as normal and simply wait there until you call queue:resume --all.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleLaravel Image Responses: Serve Resized Images Directly From Routes](https://www.msaied.com/public/articles/laravel-image-responses-serve-resized-images-directly-from-routes) [Next articleRead/Write Splitting, Connection Pooling, and Sticky Reads in Laravel](https://www.msaied.com/public/articles/readwrite-splitting-connection-pooling-and-sticky-reads-in-laravel-6)  

   On this page
-------------

1. [The Deploy Race Condition Every Laravel Developer Knows](#the-deploy-race-condition-every-laravel-developer-knows)
2. [The Commands](#the-commands)
3. [What Pausing Actually Does](#what-pausing-actually-does)
4. [Individual and Global Pauses Are Independent](#individual-and-global-pauses-are-independent)
5. [Events](#events)
6. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
