Never Miss a Laravel Release 🚀
The Laravel team released a patch version, v12.40.2, which can pause a queue for a given number of seconds. Building on the Laravel 12.40 release, which introduced pausing and resuming a queue indefinitely, now you can specify a number of seconds to pause the queue:
PR ~#57800~ added the QueueManager@pause() method to allow pausing a given queue.
This method pauses the queue indefinitely by using a cache's store forever() method.
As such a queue can only be resumed by calling the QueueManager@resume() method added in the same PR...
[This PR] adds the QueueManager
pauseFor()method that allows passing the number of seconds a queue should be paused.
When you want to pause a queue for a given number of seconds programatically, you can do so using the Queue (queue service) and the pauseFor() method:
Queue::pauseFor(connection: 'redis', queue: 'default', ttl: 30);
See Pull Request #57917 for more details.
In last week's minor release, v12.40.0, you can now pause a queue programmatically or via a console command using the connection name and the queue name:
# connection_name:queue_namephp artisan queue:pause database:default php artisan queue:continue database:default
Release notes
You can see the complete list of new features and updates below and the diff between 12.40.0 and 12.40.2 on GitHub. The following release notes are directly from the changelog:
v12.40.2
- [12.x] Modernize type casting by @lucasmichot in https://github.com/laravel/framework/pull/57914
- [12.x] Improve missing attribute violation callable typehints by @mosabbirrakib in https://github.com/laravel/framework/pull/57910
- [12.x] Improve discarded attribute violation callable typehints by @mosabbirrakib in https://github.com/laravel/framework/pull/57909
- [12.x] add support for no mode in postgres full text search by @opheus2 in https://github.com/laravel/framework/pull/57915
- [12.x] Guard RedisStore::scan() results against boolean failures by @CicerBro in https://github.com/laravel/framework/pull/57911
- [12.x] Fix CallQueuedClosure::displayName after batch chain (#57597) by @CreareWorks in https://github.com/laravel/framework/pull/57881
- Pass Laravel context through with schedule tasks by @jradtilbrook in https://github.com/laravel/framework/pull/57918
- [12.x] Test Improvements by @crynobone in https://github.com/laravel/framework/pull/57926
- [12.x] Eloquent Builder: completion for HigherOrderBuilderProxy fields by @adelf in https://github.com/laravel/framework/pull/57928
- [12.x] fix: continue route matching rather than returning second fallbackRoute by @ryzr in https://github.com/laravel/framework/pull/57922
- [12.x] Pause a queue for given seconds by @rodrigopedra in https://github.com/laravel/framework/pull/57917
- Json Schema Contract by @taylorotwell in https://github.com/laravel/framework/pull/57934
v12.40.1
- Add support for instant column additions by @taylorotwell in https://github.com/laravel/framework/pull/57907