Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
formatting
  • Loading branch information
taylorotwell committed Oct 4, 2025
commit 3d281fbdda9221c1d4c7d6ac11a99e01559a31ac
27 changes: 7 additions & 20 deletions src/HorizonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,15 @@ protected function configure()
__DIR__.'/../config/horizon.php', 'horizon'
);

$horizonRedisConnectionName = config('horizon.use', 'default');
$connection = config('horizon.use', 'default');

$this->checkIsReservedConnectionName($horizonRedisConnectionName);
if ($connection === 'horizon' || config()->has('database.redis.horizon')) {
throw new InvalidArgumentException(
'The Redis connection name [horizon] is reserved for internal use.'
);
}

Horizon::use($horizonRedisConnectionName);
Horizon::use($connection);
}

/**
Expand Down Expand Up @@ -194,21 +198,4 @@ protected function registerQueueConnectors()
});
});
}

/**
* Check if a given Redis connection name is reserved by Horizon.
*
* @param string $connection
* @return void
*
* @throws \Exception
*/
protected function checkIsReservedConnectionName(string $connection): void
{
if ($connection === 'horizon' || config()->has('database.redis.horizon')) {
throw new InvalidArgumentException(
'The Redis connection name [horizon] is reserved for internal use.'
);
}
}
}