Merge "In ParserCache, respect $useOutdated"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 2 May 2016 14:42:29 +0000 (14:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 May 2016 14:42:29 +0000 (14:42 +0000)
1  2 
includes/parser/ParserCache.php

@@@ -146,11 -146,10 +146,11 @@@ class ParserCache 
                        if ( !$useOutdated && $optionsKey->expired( $article->getTouched() ) ) {
                                wfIncrStats( "pcache.miss.expired" );
                                $cacheTime = $optionsKey->getCacheTime();
 -                              wfDebug( "Parser options key expired, touched " . $article->getTouched()
 +                              wfDebugLog( "ParserCache",
 +                                      "Parser options key expired, touched " . $article->getTouched()
                                        . ", epoch $wgCacheEpoch, cached $cacheTime\n" );
                                return false;
-                       } elseif ( $optionsKey->isDifferentRevision( $article->getLatest() ) ) {
+                       } elseif ( !$useOutdated && $optionsKey->isDifferentRevision( $article->getLatest() ) ) {
                                wfIncrStats( "pcache.miss.revid" );
                                $revId = $article->getLatest();
                                $cachedRevId = $optionsKey->getCacheRevisionId();
                if ( !$useOutdated && $value->expired( $touched ) ) {
                        wfIncrStats( "pcache.miss.expired" );
                        $cacheTime = $value->getCacheTime();
 -                      wfDebug( "ParserOutput key expired, touched $touched, "
 +                      wfDebugLog( "ParserCache",
 +                              "ParserOutput key expired, touched $touched, "
                                . "epoch $wgCacheEpoch, cached $cacheTime\n" );
                        $value = false;
-               } elseif ( $value->isDifferentRevision( $article->getLatest() ) ) {
+               } elseif ( !$useOutdated && $value->isDifferentRevision( $article->getLatest() ) ) {
                        wfIncrStats( "pcache.miss.revid" );
                        $revId = $article->getLatest();
                        $cachedRevId = $value->getCacheRevisionId();