From df3b7673231443a2b8e54fc6ed565857378e3077 Mon Sep 17 00:00:00 2001 From: George Dumitrescu Date: Tue, 3 Nov 2026 12:21:22 +0200 Subject: [PATCH] fix(laravel): keep Horizon to sites that queue to Redis Horizon only reads Redis queues, so on a site with QUEUE_CONNECTION=database it ran while the jobs sat in the table. Horizon's check and the queue worker's exclude_check now carry when_env: QUEUE_CONNECTION=redis, so a lerd that understands the key runs the queue worker on any other connection. Each rule keeps its composer match, so an older lerd that drops when_env reads exactly the rule it reads today. The Horizon package also gains a doctor warning for QUEUE_CONNECTION=database, which tells users on an older lerd why their jobs are not being processed. Refs lerd-env/lerd#2428 --- frameworks/laravel/10.yaml | 2 ++ frameworks/laravel/11.yaml | 2 ++ frameworks/laravel/12.yaml | 2 ++ frameworks/laravel/13.yaml | 2 ++ frameworks/laravel/6.yaml | 2 ++ frameworks/laravel/7.yaml | 2 ++ frameworks/laravel/8.yaml | 2 ++ frameworks/laravel/9.yaml | 2 ++ packages/laravel-horizon.yaml | 15 +++++++++++++++ 9 files changed, 31 insertions(+) diff --git a/frameworks/laravel/10.yaml b/frameworks/laravel/10.yaml index b13e4c5..f84298b 100644 --- a/frameworks/laravel/10.yaml +++ b/frameworks/laravel/10.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -134,6 +135,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue vite: diff --git a/frameworks/laravel/11.yaml b/frameworks/laravel/11.yaml index f10dedc..44c1eca 100644 --- a/frameworks/laravel/11.yaml +++ b/frameworks/laravel/11.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -151,6 +152,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue vite: diff --git a/frameworks/laravel/12.yaml b/frameworks/laravel/12.yaml index 18e37b0..2c86ba2 100644 --- a/frameworks/laravel/12.yaml +++ b/frameworks/laravel/12.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -151,6 +152,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue vite: diff --git a/frameworks/laravel/13.yaml b/frameworks/laravel/13.yaml index e568636..41f2838 100644 --- a/frameworks/laravel/13.yaml +++ b/frameworks/laravel/13.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -151,6 +152,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue vite: diff --git a/frameworks/laravel/6.yaml b/frameworks/laravel/6.yaml index d373ed5..faa7ad6 100644 --- a/frameworks/laravel/6.yaml +++ b/frameworks/laravel/6.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -134,6 +135,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue # Mix rebuilds into public/, which nginx already serves, so unlike vite there diff --git a/frameworks/laravel/7.yaml b/frameworks/laravel/7.yaml index 3c0ea75..706ee67 100644 --- a/frameworks/laravel/7.yaml +++ b/frameworks/laravel/7.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -134,6 +135,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue # Mix rebuilds into public/, which nginx already serves, so unlike vite there diff --git a/frameworks/laravel/8.yaml b/frameworks/laravel/8.yaml index d762239..d11298e 100644 --- a/frameworks/laravel/8.yaml +++ b/frameworks/laravel/8.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -134,6 +135,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue # Mix rebuilds into public/, which nginx already serves, so unlike vite there diff --git a/frameworks/laravel/9.yaml b/frameworks/laravel/9.yaml index eaa2e3e..a0ed579 100644 --- a/frameworks/laravel/9.yaml +++ b/frameworks/laravel/9.yaml @@ -120,6 +120,7 @@ workers: restart: always exclude_check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis schedule: label: Task Scheduler icon: clock @@ -134,6 +135,7 @@ workers: restart: always check: composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue vite: diff --git a/packages/laravel-horizon.yaml b/packages/laravel-horizon.yaml index 6b0a3ab..d786bd6 100644 --- a/packages/laravel-horizon.yaml +++ b/packages/laravel-horizon.yaml @@ -11,6 +11,11 @@ workers: command: php artisan horizon reload_command: php artisan horizon:listen restart: always + # Horizon reads only Redis. Paired with composer so a binary that predates + # when_env still sees the rule it always did. + check: + composer: laravel/horizon + when_env: QUEUE_CONNECTION=redis conflicts_with: - queue @@ -21,3 +26,13 @@ suggest_services: reason: Horizon runs its queues on Redis - name: valkey reason: Redis-compatible queues for Horizon + +doctor: + checks: + - name: horizon_queue_connection + type: env_combo + check: + composer: laravel/horizon + warn_if: + QUEUE_CONNECTION: database + detail: "Horizon only processes Redis queues, and QUEUE_CONNECTION is database. Set QUEUE_CONNECTION=redis to use Horizon, or run the queue worker for database jobs."