Skip to content

Commit 1ac5370

Browse files
authored
Fixes the issue when using cache:clear with PhpRedis and a clustered Redis instance, by updating the PhpRedisConnection flushdb method to use the already open/configured clients. (#36665)
1 parent 5df09b1 commit 1ac5370

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Illuminate/Redis/Connections/PhpRedisConnection.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,8 @@ public function flushdb()
484484
return $this->command('flushdb');
485485
}
486486

487-
foreach ($this->client->_masters() as [$host, $port]) {
488-
$redis = tap(new Redis)->connect($host, $port);
489-
490-
if (isset($this->config['password']) && ! empty($this->config['password'])) {
491-
$redis->auth($this->config['password']);
492-
}
493-
494-
$redis->flushDb();
487+
foreach ($this->client->_masters() as $master) {
488+
$this->client->flushDb($master);
495489
}
496490
}
497491

0 commit comments

Comments
 (0)