jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/339330 )
Change subject: Use HashBag instead of EmptyBag
..
Use HashBag instead of EmptyBag
If the local cluster cache is an EmptyBagOfStuff, fall back to a
HashBagOStuff to at least cache for the duration of the request.
Also logs a warning, so we can easily tell on production if we're
only pretending to cache things.
Bug: T128692
Change-Id: I570cdcc7347312bb246848b5d43d22ce1720d3f1
---
M gateway_common/LocalClusterPsr6Cache.php
1 file changed, 17 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Awight: Looks good to me, approved
diff --git a/gateway_common/LocalClusterPsr6Cache.php
b/gateway_common/LocalClusterPsr6Cache.php
index 30740d8..ed7e32e 100644
--- a/gateway_common/LocalClusterPsr6Cache.php
+++ b/gateway_common/LocalClusterPsr6Cache.php
@@ -11,8 +11,23 @@
* (no constructor-parameters need to be specified)
*/
class LocalClusterPsr6Cache extends BagOStuffPsrCache {
+
+ /**
+* @var BagOStuff
+*/
+ protected static $mainCache = null;
+
public function __construct() {
- $mainCache = ObjectCache::getLocalClusterInstance();
- parent::__construct( $mainCache );
+ if ( self::$mainCache === null ) {
+ self::$mainCache =
ObjectCache::getLocalClusterInstance();
+ if ( self::$mainCache instanceof EmptyBagOStuff ) {
+ // FIXME: where does this go?
+ wfLogWarning(
+ 'ObjectCache::getLocalClusterInstance()
returned EmptyBagOStuff, using HashBagOStuff'
+ );
+ self::$mainCache = new HashBagOStuff();
+ }
+ }
+ parent::__construct( self::$mainCache );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/339330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I570cdcc7347312bb246848b5d43d22ce1720d3f1
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg
Gerrit-Reviewer: AndyRussG
Gerrit-Reviewer: Awight
Gerrit-Reviewer: Cdentinger
Gerrit-Reviewer: Eileen
Gerrit-Reviewer: Ejegg
Gerrit-Reviewer: Katie Horn
Gerrit-Reviewer: Ssmith
Gerrit-Reviewer: XenoRyet
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits