* @file
* @ingroup JobQueue
*/
+use \MediaWiki\MediaWikiServices;
/**
* Job to prune link tables for pages that were deleted
}
$pageId = $this->params['pageId'];
+
+ // Serialize links updates by page ID so they see each others' changes
+ $scopedLock = LinksUpdate::acquirePageLock( wfGetDB( DB_MASTER ), $pageId, 'job' );
+
if ( WikiPage::newFromID( $pageId, WikiPage::READ_LATEST ) ) {
// The page was restored somehow or something went wrong
$this->setLastError( "deleteLinks: Page #$pageId exists" );
return false;
}
+ $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $timestamp = isset( $this->params['timestamp'] ) ? $this->params['timestamp'] : null;
$page = WikiPage::factory( $this->title ); // title when deleted
- $update = new LinksDeletionUpdate( $page, $pageId );
+
+ $update = new LinksDeletionUpdate( $page, $pageId, $timestamp );
+ $update->setTransactionTicket( $factory->getEmptyTransactionTicket( __METHOD__ ) );
DataUpdate::runUpdates( [ $update ] );
return true;