Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 4389fd1

Browse files
committed
Added soft default to replication driver check
1 parent 1446cf8 commit 4389fd1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PubSub/Drivers/RedisClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function channelMemberCounts(string $appId, array $channelNames): Promise
257257
*/
258258
protected function getConnectionUri()
259259
{
260-
$name = config('websockets.replication.redis.connection') ?? 'default';
260+
$name = config('websockets.replication.redis.connection') ?: 'default';
261261
$config = config('database.redis')[$name];
262262

263263
$host = $config['host'];

src/WebSocketsServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ public function boot()
5757

5858
protected function configurePubSub()
5959
{
60-
if (config('websockets.replication.driver') === 'local') {
60+
if (config('websockets.replication.driver', 'local') === 'local') {
6161
$this->app->singleton(ReplicationInterface::class, function () {
6262
return new LocalClient;
6363
});
6464
}
6565

66-
if (config('websockets.replication.driver') === 'redis') {
66+
if (config('websockets.replication.driver', 'local') === 'redis') {
6767
$this->app->singleton(ReplicationInterface::class, function () {
6868
return (new RedisClient)->boot($this->loop ?? LoopFactory::create());
6969
});

0 commit comments

Comments
 (0)