Only update the cache on cache miss

Change I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe added an indiscriminant call
to writeCache(). I assume that it was supposed to be regulated by the check for
$this->isRecall() (which is a getter for '$this->recall'), but there was no
concomitant change to ensure that recall is set true on cache hits.

My fix does not set recall to true. The style of "pass-by-attribute" is tricky
and should be factored out by a subsequent change. This change moves the call
to writeCache() so that it is only called on cache miss.

Change-Id: I9b690e55001859c97fd40330272791d49ec6de75
This commit is contained in:
Ori Livneh 2013-02-21 17:32:12 -08:00
parent 7831957091
commit 9ba4ef269d
2 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,6 @@ class MathHooks {
if ( $wgUseMathJax && $mode == MW_MATH_MATHJAX ) {
$parser->getOutput()->addModules( array( 'ext.math.mathjax.enabler' ) );
}
$renderer->writeCache();
return $wgContLang->armourMath( $renderedMath );
}

View File

@ -34,6 +34,7 @@ class MathTexvc extends MathRenderer {
if ( $result != MW_TEXVC_SUCCESS ) {
return $result;
}
$this->writeCache();
}
return $this->doHTMLRender();
}