use MediaWiki\Logger\LoggerFactory;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IResultWrapper;
use MediaWiki\MediaWikiServices;
/**
/** @var int Number of line to return by nextHistoryLine() (constructor) */
private $historyLine;
- /** @var int Result of the query for the file's history (nextHistoryLine) */
+ /** @var IResultWrapper|null Result of the query for the file's history (nextHistoryLine) */
private $historyRes;
/** @var string Major MIME type */
wfDebugLog( 'imagemove', "Finished moving {$this->name}" );
- // Purge the source and target files...
+ // Purge the source and target files outside the transaction...
$oldTitleFile = $localRepo->newFile( $this->title );
$newTitleFile = $localRepo->newFile( $target );
- // To avoid slow purges in the transaction, move them outside...
DeferredUpdates::addUpdate(
new AutoCommitUpdate(
$this->getRepo()->getMasterDB(),
function () use ( $oldTitleFile, $newTitleFile, $archiveNames ) {
$oldTitleFile->purgeEverything();
foreach ( $archiveNames as $archiveName ) {
+ /** @var OldLocalFile $oldTitleFile */
$oldTitleFile->purgeOldThumbnails( $archiveName );
}
$newTitleFile->purgeEverything();