Skip to content

Commit

Permalink
Fetch Redis server info for sentinel replicated connections (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
yatsukhnenko authored Jul 29, 2024
1 parent e3b8fb2 commit bd85288
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ 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) {
} else if ($this->is_predis() && $this->redis->getConnection() instanceof Predis\Connection\Replication\ReplicationInterface) {
$info = $this->redis->getClientBy( 'role' , 'master' )->info();
} else {
$info = $this->redis->info();
Expand Down

0 comments on commit bd85288

Please sign in to comment.