From: Aaron Schulz Date: Tue, 26 Apr 2016 19:43:51 +0000 (-0700) Subject: Make refreshLinksJob explicitly check the cache rev ID X-Git-Tag: 1.31.0-rc.0~7124^2~1 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=cbc9745eb62dc8e86b7a322581286eb5bf771eae;p=lhc%2Fweb%2Fwiklou.git Make refreshLinksJob explicitly check the cache rev ID This is needed if the $useOutdated behavior of ParserCache is modified per Ibd111bed203dd. Bug: T133659 Change-Id: I70806dffba8af255d7cdad7663132b58479f63e3 --- diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 15ee980b36..927cafd7ac 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -185,17 +185,21 @@ class RefreshLinksJob extends Job { } if ( $page->getTouched() >= $skewedTimestamp || $opportunistic ) { - // Something bumped page_touched since this job was made - // or the cache is otherwise suspected to be up-to-date + // Something bumped page_touched since this job was made or the cache is + // otherwise suspected to be up-to-date. As long as the cache rev ID matches + // and it reflects the job's triggering change, then it is usable. $parserOutput = ParserCache::singleton()->getDirty( $page, $parserOptions ); - if ( $parserOutput && $parserOutput->getCacheTime() < $skewedTimestamp ) { + if ( !$parserOutput + || $parserOutput->getCacheRevisionId() != $revision->getId() + || $parserOutput->getCacheTime() < $skewedTimestamp + ) { $parserOutput = false; // too stale } } } // Fetch the current revision and parse it if necessary... - if ( $parserOutput == false ) { + if ( !$parserOutput ) { $start = microtime( true ); // Revision ID must be passed to the parser output to get revision variables correct $parserOutput = $content->getParserOutput(