Manual:RefreshLinksJob.php/cs

Category:MediaWiki code/cs#RefreshLinksJob.php

Soubor RefreshLinksJob.php obsahuje třídu RefreshLinksJob pro úlohy, které aktualizují odkazy pro daný titul. Tyto úlohy používají třídu LinksUpdate k aktualizaci několika databázových tabulek.

Výjimky

Práce refreshLink se dodávají ve třech různých variantách:

  1. Rekurzivní úlohy pro aktualizaci odkazů na stránky se zpětnými odkazy pro daný titul. Jsou plánovány podle LinksUpdate::queueRecursiveJobsForTable() a používají se k obnovení stránek, které odkazují / zahrnují daný titul. These jobs have (recursive:true,table:<table>) set. They just look up which pages link to the job title and schedule them as a set of non-recursive RefreshLinksJob jobs (and possibly, one new recursive job as a way of continuation).
  2. Jobs to update links for a set of pages (the job title is ignored). These jobs have (pages:(<page ID>:(<namespace>,<title>),...) set.
  3. Jobs to update links for a single page (the job title). These jobs need no extra fields set.

Parameters

Job parameters for all jobs

recursivebooleanWhen false, updates the current page. When true, updates the pages which link/transclude the current page.
triggeringRevisionIdinteger The revision of the edit which caused the link refresh. For manually triggered updates, the last revision of the page (at the time of scheduling).
triggeringUserarray The user who triggered the refresh, in the form of a [ 'userId' => int, 'userName' => string ] array. This is not necessarily the user who created the revision.
triggeredRecursivebooleanSet on all jobs which were partitioned from another, recursive job. Intended for debugging.

Standard deduplication params

See also JobQueue::deduplicateRootJob().

For recursive jobs :

tablestringWhich table to use (imagelinks or templatelinks) when searching for affected pages.
rangearray Used for recursive jobs when some pages have already been partitioned into separate jobs. Contains the list of ranges that still need to be partitioned. See BacklinkJobUtils::partitionBacklinkJob().
divisionNumber of times the job was partitioned already (for debugging).

}

For non-recursive jobs :

pagesarrayAssociative array of [ <page ID> => [ <namespace>, <dbkey> ] ]. Might be omitted, then the job title will be used.
isOpportunisticboolean Set for opportunistic single-page updates. These are "free" updates that are queued when most of the work needed to be performed anyway for non-linkrefresh-related reasons, and can be more easily discarded if they don't seem useful. See WikiPage::triggerOpportunisticLinksUpdate().
useRecursiveLinksUpdatebooleanWhen true, triggers recursive jobs for each page.

Metrics

  • refreshlinks_warning.<warning> : a recoverable issue. The job will continue as normal.
  • refreshlinks_outcome.<reason> : if the job ends with an unusual outcome, it will increment this exactly once.
    • The reason starts with bad_ : a failure is logged and the job may be retried later.
    • The reason starts with good_ : the job was cancelled and considered a success, i.e. it was superseded.

Public methods

  • newPrioritized()
  • newDynamic()
  • run()
  • getDeduplicationInfo()
  • workItemCount()

See also

Category:MediaWiki code/cs