mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-15 11:31:40 +00:00
Avoid wfMessage() call in Gadget cache updates
This avoids purge problems due to layered caching. The message cache is known to take a while to regenerate and uses lockTSE=300. Bug: T157210 Change-Id: I418e160ddb61c4d3654780f5d2bbb14bc2827e2a
This commit is contained in:
parent
c0b3041fad
commit
f53828bf57
|
@ -108,12 +108,14 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo {
|
||||||
*/
|
*/
|
||||||
public function fetchStructuredList( $forceNewText = null ) {
|
public function fetchStructuredList( $forceNewText = null ) {
|
||||||
if ( $forceNewText === null ) {
|
if ( $forceNewText === null ) {
|
||||||
$g = wfMessage( "gadgets-definition" )->inContentLanguage();
|
// T157210: avoid using wfMessage() to avoid staleness due to cache layering
|
||||||
if ( !$g->exists() ) {
|
$title = Title::makeTitle( NS_MEDIAWIKI, 'Gadgets-definition' );
|
||||||
|
$rev = Revision::newFromTitle( $title );
|
||||||
|
if ( !$rev || !$rev->getContent() || $rev->getContent()->isEmpty() ) {
|
||||||
return false; // don't cache
|
return false; // don't cache
|
||||||
}
|
}
|
||||||
|
|
||||||
$g = $g->plain();
|
$g = $rev->getContent()->getNativeData();
|
||||||
} else {
|
} else {
|
||||||
$g = $forceNewText;
|
$g = $forceNewText;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue