use MWException;
use WANObjectCache;
use Wikimedia\Assert\Assert;
+use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\LoadBalancer;
// TODO: change key, since this is not necessarily revision text!
$this->cache->makeKey( 'revisiontext', 'textid', $blobAddress ),
$this->getCacheTTL(),
- function () use ( $blobAddress, $queryFlags ) {
+ function ( $unused, &$ttl, &$setOpts ) use ( $blobAddress, $queryFlags ) {
+ list( $index ) = DBAccessObjectUtils::getDBOptions( $queryFlags );
+ $setOpts += Database::getCacheSetOptions( $this->getDBConnection( $index ) );
+
return $this->fetchBlob( $blobAddress, $queryFlags );
},
[ 'pcGroup' => self::TEXT_CACHE_GROUP, 'pcTTL' => IExpiringStore::TTL_PROC_LONG ]
return false;
}
+ if ( in_array( 'error', $blobFlags ) ) {
+ // Error row, return false
+ return false;
+ }
+
if ( in_array( 'gzip', $blobFlags ) ) {
# Deal with optional compression of archived pages.
# This can be done periodically via maintenance/compressOld.php, and