* @ingroup Cache
*/
+use MediaWiki\MediaWikiServices;
+
/**
* Job to purge the cache for all pages that link to or use another page or file
*
$touchTimestamp = wfTimestampNow();
$dbw = wfGetDB( DB_MASTER );
+ $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
// Update page_touched (skipping pages already touched since the root job).
// Check $wgUpdateRowsPerQuery for sanity; batch jobs are sized by that already.
foreach ( array_chunk( $pageIds, $wgUpdateRowsPerQuery ) as $batch ) {
- $dbw->commit( __METHOD__, 'flush' );
- wfGetLBFactory()->waitForReplication();
+ $factory->commitAndWaitForReplication( __METHOD__, $ticket );
$dbw->update( 'page',
[ 'page_touched' => $dbw->timestamp( $touchTimestamp ) ],