36 $this->removeDuplicates =
true;
39 public function run() {
40 if ( $this->title ===
null ) {
45 $pageId = $this->params[
'pageId'];
48 $scopedLock = LinksUpdate::acquirePageLock(
wfGetDB(
DB_PRIMARY ), $pageId,
'job' );
49 if ( $scopedLock ===
null ) {
50 $this->
setLastError(
'LinksUpdate already running for this page, try again later.' );
54 $services = MediaWikiServices::getInstance();
55 $wikiPageFactory = $services->getWikiPageFactory();
56 if ( $wikiPageFactory->newFromID( $pageId, WikiPage::READ_LATEST ) ) {
58 $this->
setLastError(
"deleteLinks: Page #$pageId exists" );
62 $factory = $services->getDBLoadBalancerFactory();
63 $timestamp = $this->params[
'timestamp'] ??
null;
64 $page = $wikiPageFactory->newFromTitle( $this->title );
67 $update->setTransactionTicket( $factory->getEmptyTransactionTicket( __METHOD__ ) );
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Job to prune link tables for pages that were deleted.
__construct(Title $title, array $params)
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.