+
+ $this->logRequest( 'delete', implode( ',', $batchKeys ), $server, $e );
+ }
+
+ return $result;
+ }
+
+ public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) {
+ /** @var RedisConnRef[]|Redis[] $conns */
+ $conns = [];
+ $batches = [];
+ foreach ( $keys as $key ) {
+ $conn = $this->getConnection( $key );
+ if ( $conn ) {
+ $server = $conn->getServer();
+ $conns[$server] = $conn;
+ $batches[$server][] = $key;
+ }
+ }
+
+ $relative = $this->expiryIsRelative( $exptime );
+ $op = ( $exptime == 0 ) ? 'persist' : ( $relative ? 'expire' : 'expireAt' );
+
+ $result = true;
+ foreach ( $batches as $server => $batchKeys ) {
+ $conn = $conns[$server];
+
+ $e = null;
+ try {
+ $conn->multi( Redis::PIPELINE );
+ foreach ( $batchKeys as $key ) {
+ if ( $exptime == 0 ) {
+ $conn->persist( $key );
+ } elseif ( $relative ) {
+ $conn->expire( $key, $this->convertToRelative( $exptime ) );
+ } else {
+ $conn->expireAt( $key, $this->convertToExpiry( $exptime ) );
+ }
+ }
+ $batchResult = $conn->exec();
+ if ( $batchResult === false ) {
+ $this->logRequest( $op, implode( ',', $batchKeys ), $server, true );
+ continue;
+ }
+ $result = in_array( false, $batchResult, true ) ? false : $result;
+ } catch ( RedisException $e ) {
+ $this->handleException( $conn, $e );
+ $result = false;
+ }
+
+ $this->logRequest( $op, implode( ',', $batchKeys ), $server, $e );