Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion config/horizon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down