Skip to content

Conversation

@chinmaypurav
Copy link
Contributor

@chinmaypurav chinmaypurav commented Jan 5, 2026

This pull request updates the PauseCommand for Laravel queues to add support for pausing a queue for a specified duration. The command now accepts an optional --for parameter to indicate how many seconds the queue should be paused.

Command signature and behavior changes:

  • Added a --for option to the queue:pause command, allowing users to specify the number of seconds to pause the queue.
  • Updated the command logic to use the new pauseFor method on the QueueManager, passing the value of the --for option.
image

@shaedrich
Copy link
Contributor

shaedrich commented Jan 5, 2026

Would it make sense allow other units?

If yes, how would that look like?

php artisan queue:pause default --for { "minutes": 15 }
php artisan queue:pause default --forMinutes 15
php artisan queue:pause default --for 15 --unit minutes

@chinmaypurav
Copy link
Contributor Author

Would it make sense allow other units?

If yes, how would that look like?

php artisan queue:pause default --for { "minutes": 15 }
php artisan queue:pause default --forMinutes 15
php artisan queue:pause default --for 15 --unit minutes

Just wanted to keep it simple like

Queue:pauseFor('database', 'default', 60);

Also if we look at other signatures, we always deal in seconds

image

@shaedrich
Copy link
Contributor

not very convenient but at least consistent

@amirhshokri
Copy link
Contributor

It's duplicate: #58186

@taylorotwell
Copy link
Member

I haven't seen a real world use case demonstrated yet for knowing ahead of time exactly how long you want to pause queues for.

@chinmaypurav
Copy link
Contributor Author

I haven't seen a real world use case demonstrated yet for knowing ahead of time exactly how long you want to pause queues for.

I am having a real use case for one of our data warehouse application.

The application processes data from queue and Google looker studio is connected to that.
Now lookerstudio is generating some dynamic views, which is locking the tables in our DB for like 10 minutes and 1 such process is taking 1 hour long. The looker studio is managed by our data analyst.

So if I can have the pause for functionality #57917 from the artisan command directly, it would be real helpful as opposed to create a custom command which does pause for.

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.

4 participants