Skip to content

Commit eb4e18a

Browse files
committed
upd
1 parent 4f4a01a commit eb4e18a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Cache.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,12 @@ protected function flushValues()
371371
* defined in this instance. Only used in getValue() and getValues().
372372
* @since 2.0.8
373373
* @return array|string|ConnectionInterface
374-
* @throws \yii\base\InvalidConfigException|\yii\base\NotSupportedException
374+
* @throws \yii\base\InvalidConfigException
375375
*/
376376
protected function getReplica()
377377
{
378-
if ($this->enableReplicas === false) {
378+
// @NOTE Predis uses its own implementation of balancing
379+
if ($this->enableReplicas === false || $this->redis instanceof \yii\redis\Predis\PredisConnection) {
379380
return $this->redis;
380381
}
381382

@@ -387,12 +388,6 @@ protected function getReplica()
387388
return $this->_replica = $this->redis;
388389
}
389390

390-
if ($this->redis instanceof \yii\redis\Predis\PredisConnection) {
391-
throw new \yii\base\NotSupportedException(
392-
'predis on supported replicas',
393-
);
394-
}
395-
396391
$replicas = $this->replicas;
397392
shuffle($replicas);
398393
$config = array_shift($replicas);

0 commit comments

Comments
 (0)