Manual:RefreshLinksJob.php/cs
Soubor MediaWiki: RefreshLinksJob.php | |
---|---|
Lokalita: | includes/jobqueue/jobs/ |
Zdrojový kód: | master • 1.43.1 • 1.42.6 • 1.39.12 |
Třídy: | RefreshLinksJob |
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:
- 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). - Jobs to update links for a set of pages (the job title is ignored). These jobs have (pages:(<page ID>:(<namespace>,<title>),...) set.
- Jobs to update links for a single page (the job title). These jobs need no extra fields set.
Parameters
Job parameters for all jobs
recursive | boolean | When false, updates the current page. When true, updates the pages which link/transclude the current page. |
triggeringRevisionId | integer | 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). |
triggeringUser | array | 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. |
triggeredRecursive | boolean | Set on all jobs which were partitioned from another, recursive job. Intended for debugging. |
Standard deduplication params
See also JobQueue::deduplicateRootJob() .
For recursive jobs :
table | string | Which table to use (imagelinks or templatelinks) when searching for affected pages. |
range | array | 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() . |
division | Number of times the job was partitioned already (for debugging). |
}
For non-recursive jobs :
pages | array | Associative array of [ <page ID> => [ <namespace>, <dbkey> ] ] . Might be omitted, then the job title will be used. |
isOpportunistic | boolean | 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() . |
useRecursiveLinksUpdate | boolean | When 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.
- The reason starts with
Public methods
- newPrioritized()
- newDynamic()
- run()
- getDeduplicationInfo()
- workItemCount()