r44859 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44858‎ | r44859 | r44860 >
Date:20:59, 20 December 2008
Author:ialex
Status:ok
Tags:
Comment:
Use $wgInterwikiExpiry to set the expiry time of interwiki cache
Modified paths:
  • /trunk/phase3/includes/Interwiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Interwiki.php
@@ -139,7 +139,7 @@
140140 *
141141 */
142142 protected static function load( $prefix ) {
143 - global $wgMemc;
 143+ global $wgMemc, $wgInterwikiExpiry;
144144 $key = wfMemcKey( 'interwiki', $prefix );
145145 $mc = $wgMemc->get( $key );
146146 $iw = false;
@@ -157,12 +157,12 @@
158158 $iw = Interwiki::loadFromArray( $row );
159159 if( $iw ) {
160160 $mc = array( 'iw_url' => $iw->mURL, 'iw_local' => $iw->mLocal, 'iw_trans' => $iw->mTrans );
161 - $wgMemc->add( $key, $mc );
 161+ $wgMemc->add( $key, $mc, $wgInterwikiExpiry );
162162 return $iw;
163163 } else {
164164 # Pages like "Command & Conquer 3: Kane's Wrath" may keep checking
165165 # the prefix. Cache the negative result to avoid extra db hits.
166 - $wgMemc->add( $key, 0 );
 166+ $wgMemc->add( $key, 0, $wgInterwikiExpiry );
167167 }
168168 return false;
169169 }

Status & tagging log