summaryrefslogtreecommitdiff
path: root/includes/jobqueue/jobs/RefreshLinksJob.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/jobqueue/jobs/RefreshLinksJob.php')
-rw-r--r--includes/jobqueue/jobs/RefreshLinksJob.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php
index f82af273..1252b0b5 100644
--- a/includes/jobqueue/jobs/RefreshLinksJob.php
+++ b/includes/jobqueue/jobs/RefreshLinksJob.php
@@ -26,9 +26,9 @@
*
* This job comes in a few variants:
* - a) Recursive jobs to update links for backlink pages for a given title.
- * These jobs have have (recursive:true,table:<table>) set.
+ * These jobs have (recursive:true,table:<table>) set.
* - b) Jobs to update links for a set of pages (the job title is ignored).
- * These jobs have have (pages:(<page ID>:(<namespace>,<title>),...) set.
+ * These jobs have (pages:(<page ID>:(<namespace>,<title>),...) set.
* - c) Jobs to update links for a single page (the job title)
* These jobs need no extra fields set.
*
@@ -39,6 +39,10 @@ class RefreshLinksJob extends Job {
function __construct( $title, $params = '' ) {
parent::__construct( 'refreshLinks', $title, $params );
+ // A separate type is used just for cascade-protected backlinks
+ if ( !empty( $this->params['prioritize'] ) ) {
+ $this->command .= 'Prioritized';
+ }
// Base backlink update jobs and per-title update jobs can be de-duplicated.
// If template A changes twice before any jobs run, a clean queue will have:
// (A base, A base)
@@ -86,7 +90,7 @@ class RefreshLinksJob extends Job {
array( 'params' => $extraParams )
);
JobQueueGroup::singleton()->push( $jobs );
- // Job to update link tables for for a set of titles
+ // Job to update link tables for a set of titles
} elseif ( isset( $this->params['pages'] ) ) {
foreach ( $this->params['pages'] as $pageId => $nsAndKey ) {
list( $ns, $dbKey ) = $nsAndKey;
@@ -100,6 +104,10 @@ class RefreshLinksJob extends Job {
return true;
}
+ /**
+ * @param Title $title
+ * @return bool
+ */
protected function runForTitle( Title $title = null ) {
$linkCache = LinkCache::singleton();
$linkCache->clear();
@@ -157,7 +165,7 @@ class RefreshLinksJob extends Job {
$ellapsed = microtime( true ) - $start;
// If it took a long time to render, then save this back to the cache to avoid
// wasted CPU by other apaches or job runners. We don't want to always save to
- // cache as this cause cause high cache I/O and LRU churn when a template changes.
+ // cache as this can cause high cache I/O and LRU churn when a template changes.
if ( $ellapsed >= self::PARSE_THRESHOLD_SEC
&& $page->isParserCacheUsed( $parserOptions, $revision->getId() )
&& $parserOutput->isCacheable()