summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2022-06-15 10:40:56 +1000
committerKrinkle <krinkle@fastmail.com>2022-06-15 01:04:53 +0000
commite90b21e7157552e757ef7c40d2e56d7e08614800 (patch)
tree91a84ee7fc8d385d163532621bf5269cdf024e20
parent117ef09ed2876c61a835d251694326dfd3825023 (diff)
MessageCache: Increase the MapCacheLRU sizewmf/1.39.0-wmf.15
Quick fix for linked bug. Regression testing will be in a separate commit. Bug: T310532 Change-Id: Ibc0997c87be194e0a8a92a726de07f4dc786cd47
-rw-r--r--includes/cache/MessageCache.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 0843852bcff4..2aa45dcf8faa 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -53,6 +53,12 @@ define( 'MSG_CACHE_VERSION', 2 );
* @ingroup Cache
*/
class MessageCache implements LoggerAwareInterface {
+ /**
+ * The size of the MapCacheLRU which stores message data. The maximum
+ * number of languages which can be efficiently loaded in a given request.
+ */
+ public const MAX_REQUEST_LANGUAGES = 10;
+
private const FOR_UPDATE = 1; // force message reload
/** How long to wait for memcached locks */
@@ -197,7 +203,7 @@ class MessageCache implements LoggerAwareInterface {
$this->hookRunner = new HookRunner( $hookContainer );
// limit size
- $this->cache = new MapCacheLRU( 5 );
+ $this->cache = new MapCacheLRU( self::MAX_REQUEST_LANGUAGES );
$this->mDisable = !( $options['useDB'] ?? true );
}