44 $this->removeDuplicates = (
50 $this->params += [
'causeAction' =>
'unknown',
'causeAgent' =>
'unknown' ];
66 "htmlCacheUpdate:{$table}:{$title->getPrefixedText()}"
74 if ( isset( $this->params[
'table'] ) && !isset( $this->params[
'pages'] ) ) {
75 $this->params[
'recursive'] =
true;
79 if ( !empty( $this->params[
'recursive'] ) ) {
83 $extraParams[
'causeAction'] = $this->params[
'causeAction'];
84 $extraParams[
'causeAgent'] = $this->params[
'causeAgent'];
92 [
'params' => $extraParams ]
94 JobQueueGroup::singleton()->push( $jobs );
96 } elseif ( isset( $this->params[
'pages'] ) ) {
102 $t->getArticleID() => [
$t->getNamespace(),
$t->getDBkey() ]
116 $pageIds = array_keys( $pages );
131 $condTimestamp = $this->params[
'rootJobTimestamp'] ?? $touchTimestamp;
134 $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
135 $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
139 foreach ( $batches as $batch ) {
140 $dbw->update(
'page',
141 [
'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
142 [
'page_id' => $batch,
144 "page_touched < " . $dbw->addQuotes( $dbw->timestamp( $condTimestamp ) )
148 if ( count( $batches ) > 1 ) {
149 $factory->commitAndWaitForReplication( __METHOD__, $ticket );
156 [
'page_namespace',
'page_title' ],
159 [
'page_id' => $pageIds,
'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
165 foreach ( $titleArray as
$title ) {
173 foreach ( $titleArray as
$title ) {
180 $info = parent::getDeduplicationInfo();
181 if ( is_array( $info[
'params'] ) ) {
184 if ( isset( $info[
'params'][
'pages'] ) ) {
185 unset( $info[
'namespace'] );
186 unset( $info[
'title'] );
194 if ( !empty( $this->params[
'recursive'] ) ) {
196 } elseif ( isset( $this->params[
'pages'] ) ) {
197 return count( $this->params[
'pages'] );
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
$wgUpdateRowsPerJob
Number of rows to update per job.
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
$wgUpdateRowsPerQuery
Number of rows to update per query.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static partitionBacklinkJob(Job $job, $bSize, $cSize, $opts=[])
Break down $job into approximately ($bSize/$cSize) leaf jobs and a single partition job that covers t...
static purge(array $urlArr)
Purges a list of CDN nodes defined in $wgCdnServers.
Job to purge the cache for all pages that link to or use another page or file.
getDeduplicationInfo()
Subclasses may need to override this to make duplication detection work.
__construct(Title $title, array $params)
static newForBacklinks(Title $title, $table, $params=[])
invalidateTitles(array $pages)
static clearFileCache(Title $title)
Clear the file caches for a page for all actions.
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.
static newRootJobParams( $key)
Get "root job" parameters for a task.
static newFromResult( $res)
Represents a title within MediaWiki.
getCdnUrls()
Get a list of URLs to purge from the CDN cache when this page changes.