Foxtrott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/276981

Change subject: Add version number to cache key to avoid loading incompatible 
trees
......................................................................

Add version number to cache key to avoid loading incompatible trees

Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
---
M src/LingoParser.php
M src/Tree.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/81/276981/1

diff --git a/src/LingoParser.php b/src/LingoParser.php
index 524e4e1..5c3e4d6 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -131,7 +131,7 @@
                                // Try cache first
                                global $wgexLingoCacheType;
                                $cache = ( $wgexLingoCacheType !== null ) ? 
wfGetCache( $wgexLingoCacheType ) : wfGetMainCache();
-                               $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree' );
+                               $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree', Tree::TREE_VERSION );
                                $cachedLingoTree = $cache->get( $cachekey );
 
                                // cache hit?
diff --git a/src/Tree.php b/src/Tree.php
index ccb3c6d..4021e3c 100644
--- a/src/Tree.php
+++ b/src/Tree.php
@@ -50,6 +50,8 @@
  */
 class Tree {
 
+       const TREE_VERSION = 2;
+
        private $mTree = array();
        private $mList = array();
        private $mMinLength = 1000;

-- 
To view, visit https://gerrit.wikimedia.org/r/276981
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to