jenkins-bot has submitted this change and it was merged.
Change subject: Don't cache the gadget-defintion in case no gadgets were found
......................................................................
Don't cache the gadget-defintion in case no gadgets were found
After some investigation I could only find a few unlike
possibilities which eventually could lead to the issues
described in the bug. In the end I decided that it would
be the easiest and probably most robust solution to simply
don't cache in case no gadgets were found, even if the
MediaWiki page exists.
This shouldn't cause any performance issues as we already
don't cache in case no gadgets could be found in all paths
of this function except after trying to parse the gadget
definition.
Bug: 37228
Change-Id: I3092bcb162d032282fbe263c7f14f4d1ce9163ab
---
M Gadgets_body.php
1 file changed, 7 insertions(+), 0 deletions(-)
Approvals:
Reedy: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Gadgets_body.php b/Gadgets_body.php
index e787062..c7e23bf 100644
--- a/Gadgets_body.php
+++ b/Gadgets_body.php
@@ -614,6 +614,13 @@
}
}
+ if ( !count( $gadgets ) ) {
+ // Don't cache in case we couldn't find any gadgets.
Bug 37228
+ $gadgets = false;
+ wfProfileOut( __METHOD__ );
+ return $gadgets;
+ }
+
// cache for a while. gets purged automatically when
MediaWiki:Gadgets-definition is edited
$wgMemc->set( $key, $gadgets, 60 * 60 * 24 );
$source = $forceNewText !== null ? 'input text' :
'MediaWiki:Gadgets-definition';
--
To view, visit https://gerrit.wikimedia.org/r/73617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3092bcb162d032282fbe263c7f14f4d1ce9163ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits