Queue listener was not started on a server, some jobs where pushed (using Redis driver).
How could I count (or get all) theses jobs ? I did not found any artisan command to get this information.
Queue listener was not started on a server, some jobs where pushed (using Redis driver).
How could I count (or get all) theses jobs ? I did not found any artisan command to get this information.
If anybody is still looking approach for the older versions of the Laravel:
Since Laravel 5.3 you can simply use
Queue::size()
(see PR).You can also use the Redis Facade directly by doing this:
Tested in Laravel 5.6 but should work for all 5.X.
I am an PHP Laravel dev, 3 years, I have just known these command recently, so shame on me. ;(
If you are using
redis
driver for your queue, you can count all remaining jobs by name:To see the result immediately, you can use
php artisan tinker
and hitRedis::llen('queues:default');
.If someone still looking for an answer here is the way I do it:
$connection
is the Redis connection name which is null by default, and The$queue
is the name of the queue / tube which is 'default' by default!You can install Horizon. Laravel Horizon provides a dashboard for monitoring your queues, and allows you to do more configuration to your queue.
You have to set
.env
config file andconfig/horizon.php
file.Tested with Laravel 5.6