class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
/** @var WikiPage */
protected $page;
- /** @var integer */
+ /** @var int */
protected $pageId;
/** @var string */
protected $timestamp;
/**
* @param WikiPage $page Page we are updating
- * @param integer|null $pageId ID of the page we are updating [optional]
+ * @param int|null $pageId ID of the page we are updating [optional]
* @param string|null $timestamp TS_MW timestamp of deletion
* @throws MWException
*/
$this->page->updateCategoryCounts( [], $catBatch, $id );
if ( count( $catBatches ) > 1 ) {
$lbFactory->commitAndWaitForReplication(
- __METHOD__, $this->ticket, [ 'wiki' => $dbw->getWikiID() ]
+ __METHOD__, $this->ticket, [ 'domain' => $dbw->getDomainID() ]
);
}
}
__METHOD__
);
if ( $row ) {
- Category::newFromRow( $row, $title )->refreshCounts();
+ $cat = Category::newFromRow( $row, $title );
+ // T166757: do the update after the main job DB commit
+ DeferredUpdates::addCallableUpdate( function () use ( $cat ) {
+ $cat->refreshCounts();
+ } );
}
}
$dbw->delete( 'recentchanges', [ 'rc_id' => $rcIdBatch ], __METHOD__ );
if ( count( $rcIdBatches ) > 1 ) {
$lbFactory->commitAndWaitForReplication(
- __METHOD__, $this->ticket, [ 'wiki' => $dbw->getWikiID() ]
+ __METHOD__, $this->ticket, [ 'domain' => $dbw->getDomainID() ]
);
}
}
if ( count( $pkDeleteConds ) >= $bSize ) {
$dbw->delete( $table, $dbw->makeList( $pkDeleteConds, LIST_OR ), __METHOD__ );
$lbFactory->commitAndWaitForReplication(
- __METHOD__, $this->ticket, [ 'wiki' => $dbw->getWikiID() ]
+ __METHOD__, $this->ticket, [ 'domain' => $dbw->getDomainID() ]
);
$pkDeleteConds = [];
}
public function getAsJobSpecification() {
return [
- 'wiki' => $this->getDB()->getWikiID(),
+ 'wiki' => WikiMap::getWikiIdFromDomain( $this->getDB()->getDomainID() ),
'job' => new JobSpecification(
'deleteLinks',
[ 'pageId' => $this->pageId, 'timestamp' => $this->timestamp ],