File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -139,11 +139,10 @@ public function connect( $read_timeout = null ) {
139
139
* @return bool
140
140
*/
141
141
public function flush ( $ throw_exception = false ) {
142
- $ flush_timeout = defined ( 'WP_REDIS_FLUSH_TIMEOUT ' )
143
- ? intval ( WP_REDIS_FLUSH_TIMEOUT )
144
- : 5 ;
145
-
146
142
if ( is_null ( $ this ->redis ) ) {
143
+ $ flush_timeout = defined ( 'WP_REDIS_FLUSH_TIMEOUT ' )
144
+ ? intval ( WP_REDIS_FLUSH_TIMEOUT )
145
+ : 5 ;
147
146
try {
148
147
$ this ->connect ( $ flush_timeout );
149
148
} catch ( Exception $ exception ) {
@@ -153,16 +152,16 @@ public function flush( $throw_exception = false ) {
153
152
154
153
return false ;
155
154
}
156
- }
157
155
158
- if ( is_null ( $ this ->redis ) ) {
159
- return false ;
156
+ if ( is_null ( $ this ->redis ) ) {
157
+ return false ;
158
+ }
160
159
}
161
160
162
161
if ( defined ( 'WP_REDIS_CLUSTER ' ) ) {
163
162
try {
164
- foreach ( $ this ->redis ->_masters () as $ master ) {
165
- $ this -> redis -> flushdb ( $ master );
163
+ foreach ( $ this ->redis ->getIterator () as $ master ) {
164
+ $ master -> flushdb ();
166
165
}
167
166
} catch ( Exception $ exception ) {
168
167
if ( $ throw_exception ) {
You can’t perform that action at this time.
0 commit comments