Pause All Laravel Queues During a Deploy | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Pause All Laravel Queues During a Deploy with queue:pause --all        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)

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

 [  Laravel ](https://msaied.com/articles?category=laravel) [  Tips &amp; Tricks ](https://msaied.com/articles?category=tips-tricks)  #Laravel   #Queues   #Deployment   #Laravel 13   #PHP  

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

     13 Aug 2026      3 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   The Deploy Race Condition Every Laravel Developer Knows  ](#the-deploy-race-condition-every-laravel-developer-knows)
2. [  02   The Commands  ](#the-commands)
3. [  03   What Pausing Actually Does  ](#what-pausing-actually-does)
4. [  04   Individual and Global Pauses Are Independent  ](#individual-and-global-pauses-are-independent)
5. [  05   Events  ](#events)
6. [  06   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)*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fpause-all-laravel-queues-during-a-deploy-with-queuepause-all&text=Pause+All+Laravel+Queues+During+a+Deploy+with+queue%3Apause+--all) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fpause-all-laravel-queues-during-a-deploy-with-queuepause-all) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  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. 

      Q02  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. 

      Q03  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. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Filament v3 Custom Field Plugins: Building Reusable Inputs with Full Form Integration](https://cdn.msaied.com/547/a61037a8f397f843359f1438d70c8bc5.png) filament laravel livewire 

### Filament v3 Custom Field Plugins: Building Reusable Inputs with Full Form Integration

Learn how to build a production-ready Filament v3 custom field plugin — covering the Field contract, state hyd...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 14 Aug 2026     3 min read  

  Read    

 ](https://msaied.com/articles/filament-v3-custom-field-plugins-building-reusable-inputs-with-full-form-integration) [ ![PostgreSQL Window Functions in Laravel: Ranking, Running Totals, and Gap Detection](https://cdn.msaied.com/546/f045f6411aa801b18d8a06d0518d540a.png) laravel postgresql sql 

### PostgreSQL Window Functions in Laravel: Ranking, Running Totals, and Gap Detection

Window functions let you compute rankings, running totals, and gaps directly in SQL without self-joins or PHP...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 14 Aug 2026     4 min read  

  Read    

 ](https://msaied.com/articles/postgresql-window-functions-in-laravel-ranking-running-totals-and-gap-detection-1) [ ![Event Sourcing in Laravel: Aggregates, Projectors, and Reactors Without the Ceremony](https://cdn.msaied.com/545/14148532753288225b142923e6704a4d.png) laravel event-sourcing ddd 

### Event Sourcing in Laravel: Aggregates, Projectors, and Reactors Without the Ceremony

Event sourcing sounds academic until you need a full audit trail or time-travel debugging in production. This...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 13 Aug 2026     4 min read  

  Read    

 ](https://msaied.com/articles/event-sourcing-in-laravel-aggregates-projectors-and-reactors-without-the-ceremony) 

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

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
