File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments