Skip to content

Commit 732fddd

Browse files
committed
Fetch Redis server info for sentinel replicated connections
1 parent a4a0584 commit 732fddd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Fixed issue with Predis and `SentinelReplication` connection
6+
37
## 2.5.3
48

59
- Added `WP_REDIS_DISABLE_GROUP_FLUSH` constant

includes/object-cache.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,8 @@ public function fetch_info() {
11471147
$info = $this->is_predis()
11481148
? $this->redis->getClientBy( 'id', $connectionId )->info()
11491149
: $this->redis->info( $connectionId );
1150-
} else if ($this->is_predis() && $this->redis->getConnection() instanceof Predis\Connection\Replication\MasterSlaveReplication) {
1151-
$info = $this->redis->getClientBy( 'role' , 'master' )->info();
1150+
} else if ($this->is_predis() && $this->redis->getConnection() instanceof Predis\Connection\Replication\ReplicationInterface) {
1151+
$info = $this->redis->getMaster()->info();
11521152
} else {
11531153
$info = $this->redis->info();
11541154
}

0 commit comments

Comments
 (0)