117 $pageIds = array_keys( $pages );
122 $rootTsUnix =
wfTimestampOrNull( TS_UNIX, $this->params[
'rootJobTimestamp'] ??
null );
131 $newTouchedUnix = time();
133 $casTsUnix = $rootTsUnix ?? $newTouchedUnix;
135 $services = MediaWikiServices::getInstance();
136 $config = $services->getMainConfig();
138 $lbFactory = $services->getDBLoadBalancerFactory();
139 $dbw = $lbFactory->getMainLB()->getConnectionRef(
DB_PRIMARY );
140 $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
143 $batches = array_chunk( $pageIds, $config->get(
'UpdateRowsPerQuery' ) );
144 foreach ( $batches as $batch ) {
145 $dbw->update(
'page',
146 [
'page_touched' => $dbw->timestamp( $newTouchedUnix ) ],
149 "page_touched < " . $dbw->addQuotes( $dbw->timestamp( $casTsUnix ) )
153 if ( count( $batches ) > 1 ) {
154 $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
161 [
'page_namespace',
'page_title' ],
162 $config->get(
'PageLanguageUseDB' ) ? [
'page_lang' ] : []
164 [
'page_id' => $pageIds,
'page_touched' => $dbw->timestamp( $newTouchedUnix ) ],
169 $htmlCache = MediaWikiServices::getInstance()->getHtmlCacheUpdater();
170 $htmlCache->purgeTitleUrls(
172 $htmlCache::PURGE_NAIVE | $htmlCache::PURGE_URLS_LINKSUPDATE_ONLY,
173 [ $htmlCache::UNLESS_CACHE_MTIME_AFTER => $casTsUnix + self::NORMAL_MAX_LAG ]