I’m trying to query Redis for Horizon’s pending jobs. I can see the laravel_horizon:pending_jobs
entry in “sorted sets” when I am browsing Redis with PhpStorm’s database tool.
If I double-click the entry, I can see a list of values and scores. I can see the same result by running zrange laravel_horizon:pending_jobs 0 -1 withscores
in the PhpStorm’s Redis query console.
However, if I run this, I get an empty array:
use IlluminateSupportFacadesRedis;
$redis = Redis::connection('horizon');
dump($redis->zRange('laravel_horizon:pending_jobs', 0, -1));
I also get an empty array when using the Redis facade directly:
use IlluminateSupportFacadesRedis;
dump(Redis::zRange('laravel_horizon:pending_jobs', 0, -1));
I’m probably missing something very basic. I don’t have much experience interacting with Redis. I’m also likely overcomplicating it.