Skip to content

Commit fbcfa11

Browse files
committed
Switch back to node which were used before fetching info
1 parent d4f76c2 commit fbcfa11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/object-cache.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,11 +1151,16 @@ public function fetch_info() {
11511151
if ( $this->is_predis() ) {
11521152
$connection = $this->redis->getConnection();
11531153
if ( $connection instanceof Predis\Connection\Replication\ReplicationInterface ) {
1154+
$node = $connection->getCurrent();
11541155
$connection->switchToMaster();
11551156
}
11561157
}
11571158

11581159
$info = $this->redis->info();
1160+
1161+
if ( isset( $node ) ) {
1162+
$connection->switchTo($node);
1163+
}
11591164
}
11601165

11611166
if ( isset( $info['redis_version'] ) ) {

0 commit comments

Comments
 (0)