The queue:listen
was not run on a server, so some jobs were pushed (using Redis driver) but never run.
How could I count (or get all) these jobs? I did not find any artisan command to get this information.
If you are using redis driver for your queue, you can count all remaining jobs by name: use Redis; // List all keys with status (awaiting, reserved, delayed) Redis::keys('*'); // Count by name $queueName = 'default'; echo Redis::llen('queues:' . $queueName); // To count by status: echo Redis::zcount('queues:' .
Show activity on this post. This is lower level but in the same vein you could run a command such as ps -aux | grep queue to literally view the running queue processes on whatever server your application/queue workers are running on.
Redis Queue is a python library for queueing purposes for background handling.
If someone is still looking for an answer, here is the way I did it:
$connection = null; $default = 'default'; // For the delayed jobs var_dump( \Queue::getRedis() ->connection($connection) ->zrange('queues:'.$default.':delayed', 0, -1) ); // For the reserved jobs var_dump( \Queue::getRedis() ->connection($connection) ->zrange('queues:'.$default.':reserved', 0, -1) );
$connection
is the Redis' connection name which is null
by default, and the $default
is the name of the queue which is default
by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With