r54190 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54189‎ | r54190 | r54191 >
Date:06:41, 2 August 2009
Author:brion
Status:ok (Comments)
Tags:
Comment:
Revert r53633 "Made pre-caching actually work"
WTF? Seems to imply that memcached never works from command-line scripts, which is blatantly false.
Modified paths:
  • /trunk/extensions/CodeReview/CodeRepository.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRepository.php
@@ -216,12 +216,6 @@
217217 } else {
218218 $data = $wgMemc->get( $key );
219219 }
220 -
221 - // Try DB cache...this is used by daemonds
222 - if ( !$data && $useCache != 'skipcache' ) {
223 - $dbCache = wfGetCache( CACHE_DB );
224 - $data = $dbCache->get( $key );
225 - }
226220
227221 # Try the database...
228222 if ( !$data && $useCache != 'skipcache' ) {
@@ -249,12 +243,7 @@
250244 $svn = SubversionAdaptor::newFromRepo( $this->mPath );
251245 $data = $svn->getDiff( '', $rev1, $rev2 );
252246 // Store to cache
253 - if( php_sapi_name() != 'cli' ) {
254 - $wgMemc->set( $key, $data, 3600 * 24 * 3 );
255 - } else {
256 - $dbCache = wfGetCache( CACHE_DB ); // memcache fails in cli mode
257 - $dbCache->set( $key, $data, 3600 * 24 * 3 );
258 - }
 247+ $wgMemc->set( $key, $data, 3600 * 24 * 3 );
259248 // Permanent DB storage
260249 $storedData = $data;
261250 $flags = Revision::compressRevisionText( $storedData );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53633Made pre-caching actually workaaron02:24, 22 July 2009

Comments

#Comment by Simetrical (talk | contribs)   17:46, 2 August 2009

At least APC generally doesn't work right from command-line scripts: it uses a separate cache for web and CLI, IIRC.

Status & tagging log