diff --git a/config/horizon.php b/config/horizon.php index c2e8b3184..a1a726319 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -228,7 +228,19 @@ 'social-publishing' => [ 'connection' => 'redis', - 'queue' => Platform::allQueues(), + // Only queue platforms that are actually enabled. Reading the toggles from + // env() rather than config() is deliberate: config files are loaded in + // alphabetical order, so config('trypost.*') is not populated yet while this + // file is being evaluated - Platform::isEnabled() would always fall back to + // true here. Without this filter every supported platform gets a worker + // (minProcesses => 1), including ones the installation never connects. + 'queue' => array_values(array_filter( + Platform::allQueues(), + fn (string $queue) => filter_var( + env(Str::upper(Str::replace('-', '_', Str::after($queue, 'social-'))).'_ENABLED', true), + FILTER_VALIDATE_BOOLEAN + ) + )), 'balance' => 'auto', 'autoScalingStrategy' => 'time', 'minProcesses' => 1,