nekooee's avatar

Horizon doesn’t execute delayed jobs scheduled for the next day (24h+ delays)

I’m facing a strange issue with Laravel Horizon (v5.37) using Redis queues. Short delays (a few seconds or minutes) work perfectly, but any job delayed for the next day (e.g. 24h later) never gets executed automatically — unless I manually re-dispatch it or pause/start my system again.

Here’s my configuration:


config/horizon.php


Redis prefixes:

// horizon.php
'prefix' => env(
    'HORIZON_PREFIX',
    Str::slug(env('APP_NAME', 'laravel'), '_').'_horizon:'
),

// database.php
'options' => [
    'cluster' => env('REDIS_CLUSTER', 'redis'),
    'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],

Should these two prefixes be the same? Because they are different now.

The delayed job is stored correctly in Redis:

zrange project_database_queues:sms:delayed 0 -1 withscores

It contains:

"date": "2025-11-01 11:00:00.000000",
"timezone": "Asia/Tehran"

and the timestamp matches perfectly.

However, when the scheduled time comes, Horizon never processes it. Shorter delays (like 5 seconds or a few minutes) work fine, so this only happens with long delays (around 24h or more).

Has anyone faced this? Could Horizon or the Redis queue trimming system (trim.pending) be discarding long-term delayed jobs before execution, or is there a known limitation on 24h+ delays? Add this paragraph at the end of your Laracasts post:


Today I increased the trim.pending value to 25 hours (1500 minutes) just in case, but I’m not sure if it will make any difference. Previously, even with pending = 120, the job still existed in the Redis queue (it wasn’t trimmed or deleted) — it simply never executed when its scheduled time arrived.

0 likes
0 replies

Please or to participate in this conversation.