Skip to content

Commit

Permalink
Fetch Redis server info for sentinel replicated connections
Browse files Browse the repository at this point in the history
  • Loading branch information
yatsukhnenko committed Aug 7, 2024
1 parent a4a0584 commit 732fddd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Fixed issue with Predis and `SentinelReplication` connection

## 2.5.3

- Added `WP_REDIS_DISABLE_GROUP_FLUSH` constant
Expand Down
4 changes: 2 additions & 2 deletions includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ public function fetch_info() {
$info = $this->is_predis()
? $this->redis->getClientBy( 'id', $connectionId )->info()
: $this->redis->info( $connectionId );
} else if ($this->is_predis() && $this->redis->getConnection() instanceof Predis\Connection\Replication\MasterSlaveReplication) {
$info = $this->redis->getClientBy( 'role' , 'master' )->info();
} else if ($this->is_predis() && $this->redis->getConnection() instanceof Predis\Connection\Replication\ReplicationInterface) {
$info = $this->redis->getMaster()->info();
} else {
$info = $this->redis->info();
}
Expand Down

0 comments on commit 732fddd

Please sign in to comment.