File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -1139,24 +1139,18 @@ protected function connect_using_hhvm( $parameters ) {
1139
1139
* @return void
1140
1140
*/
1141
1141
public function fetch_info () {
1142
- $ options = method_exists ( $ this ->redis , 'getOptions ' )
1143
- ? $ this ->redis ->getOptions ()
1144
- : new stdClass ();
1145
-
1146
- if ( isset ( $ options ->replication ) && $ options ->replication ) {
1147
- return ;
1148
- }
1149
-
1150
1142
if ( defined ( 'WP_REDIS_CLUSTER ' ) ) {
1151
1143
$ connectionId = is_string ( WP_REDIS_CLUSTER )
1152
1144
? 'SERVER '
1153
1145
: current ( $ this ->build_cluster_connection_array () );
1154
1146
1155
- $ info = $ this ->determine_client () === ' predis '
1147
+ $ info = $ this ->is_predis ()
1156
1148
? $ this ->redis ->getClientBy ( 'id ' , $ connectionId )->info ()
1157
1149
: $ this ->redis ->info ( $ connectionId );
1158
1150
} else {
1159
- $ info = $ this ->redis ->info ();
1151
+ $ info = $ this ->is_predis () && $ this ->redis ->getConnection () instanceof Predis \Connection \Replication \MasterSlaveReplication
1152
+ ? $ this ->redis ->getClientBy ( 'role ' , 'master ' )->info ()
1153
+ : $ this ->redis ->info ();
1160
1154
}
1161
1155
1162
1156
if ( isset ( $ info ['redis_version ' ] ) ) {
You can’t perform that action at this time.
0 commit comments