r53633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53632‎ | r53633 | r53634 >
Date:02:24, 22 July 2009
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Made pre-caching actually work
Modified paths:
  • /trunk/extensions/CodeReview/CodeRepository.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRepository.php
@@ -196,6 +196,12 @@
197197 } else {
198198 $data = $wgMemc->get( $key );
199199 }
 200+
 201+ // Try DB cache...this is used by daemonds
 202+ if ( !$data && $useCache != 'skipcache' ) {
 203+ $dbCache = wfGetCache( CACHE_DB );
 204+ $data = $dbCache->get( $key );
 205+ }
200206
201207 # Try the database...
202208 if ( !$data && $useCache != 'skipcache' ) {
@@ -223,7 +229,12 @@
224230 $svn = SubversionAdaptor::newFromRepo( $this->mPath );
225231 $data = $svn->getDiff( '', $rev1, $rev2 );
226232 // Store to cache
227 - $wgMemc->set( $key, $data, 3600 * 24 * 3 );
 233+ if( php_sapi_name() != 'cli' ) {
 234+ $wgMemc->set( $key, $data, 3600 * 24 * 3 );
 235+ } else {
 236+ $dbCache = wfGetCache( CACHE_DB ); // memcache fails in cli mode
 237+ $dbCache->set( $key, $data, 3600 * 24 * 3 );
 238+ }
228239 // Permanent DB storage
229240 $storedData = $data;
230241 $flags = Revision::compressRevisionText( $storedData );

Follow-up revisions

RevisionCommit summaryAuthorDate
r54190Revert r53633 "Made pre-caching actually work"...brion06:41, 2 August 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   06:42, 2 August 2009

Reverted in r54190; memcached works fine from CLI and always has.

#Comment by Aaron Schulz (talk | contribs)   13:53, 2 August 2009

Gah, I meant eaccelerator/ect...

Status & tagging log