Write cache unless there *is* a cache hit:
Moves writeCache call back to hooks (changed in 9ba4ef269d
)
and makes it unconditional, so only one part of the code decides
whether to write to the cache.
Bug: 45973
Change-Id: I6b387795304ff15c960fcf0f5354a9ac939e1212
This commit is contained in:
parent
3916ac167c
commit
aa8a0eaf19
|
@ -55,6 +55,7 @@ class MathHooks {
|
||||||
if ( $wgUseMathJax && $mode == MW_MATH_MATHJAX ) {
|
if ( $wgUseMathJax && $mode == MW_MATH_MATHJAX ) {
|
||||||
$parser->getOutput()->addModules( array( 'ext.math.mathjax.enabler' ) );
|
$parser->getOutput()->addModules( array( 'ext.math.mathjax.enabler' ) );
|
||||||
}
|
}
|
||||||
|
$renderer->writeCache();
|
||||||
return $wgContLang->armourMath( $renderedMath );
|
return $wgContLang->armourMath( $renderedMath );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ class MathTexvc extends MathRenderer {
|
||||||
if ( $result != MW_TEXVC_SUCCESS ) {
|
if ( $result != MW_TEXVC_SUCCESS ) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
$this->writeCache();
|
|
||||||
}
|
}
|
||||||
return $this->doHTMLRender();
|
return $this->doHTMLRender();
|
||||||
}
|
}
|
||||||
|
@ -276,7 +275,8 @@ class MathTexvc extends MathRenderer {
|
||||||
*/
|
*/
|
||||||
public function writeCache() {
|
public function writeCache() {
|
||||||
global $wgUseSquid;
|
global $wgUseSquid;
|
||||||
if ( !$this->isRecall() ) {
|
// If cache hit, don't write anything.
|
||||||
|
if ( $this->isRecall() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->writeDBEntry();
|
$this->writeDBEntry();
|
||||||
|
|
Loading…
Reference in New Issue