Skip to content

Commit

Permalink
ignore warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss committed Oct 15, 2024
1 parent 034def1 commit 6848677
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1607,9 +1607,11 @@ protected function execute_lua_script( $script ) {

if ( $this->is_predis() ) {
$connection = $this->redis->getConnection();

if ($connection instanceof Predis\Connection\Replication\ReplicationInterface) {
$connection = $connection->getMaster();
}

$timeout = $connection->getParameters()->read_write_timeout ?? ini_get( 'default_socket_timeout' );
stream_set_timeout( $connection->getResource(), $flushTimeout );
} else {
Expand All @@ -1625,7 +1627,7 @@ protected function execute_lua_script( $script ) {
}

if ( $this->is_predis() ) {
stream_set_timeout( $connection->getResource(), $timeout );
stream_set_timeout( $connection->getResource(), $timeout ); // @phpstan-ignore variable.undefined
} else {
$this->redis->setOption( Redis::OPT_READ_TIMEOUT, $timeout );
}
Expand Down

0 comments on commit 6848677

Please sign in to comment.