r109433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109432‎ | r109433 | r109434 >
Date:21:20, 18 January 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Just experienced with commons. Dealt with UploadStashBadPathException

path doesn't exist
Backtrace:
#0 /home/wikipedia/common/php-1.18/maintenance/cleanupUploadStash.php(68): UploadStash->getFile('zyvzeiza5hg.xab...', true)
#1 /home/wikipedia/common/php-1.18/maintenance/doMaintenance.php(105): UploadStashCleanup->execute()
#2 /home/wikipedia/common/php-1.18/maintenance/cleanupUploadStash.php(75): require_once('/home/wikipedia...')
#3 /home/wikipedia/common/multiversion/MWScript.php(73): require_once('/home/wikipedia...')
#4 {main}
Modified paths:
  • /trunk/phase3/maintenance/cleanupUploadStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/cleanupUploadStash.php
@@ -69,8 +69,13 @@
7070 $stash = new UploadStash( $repo );
7171
7272 foreach( $keys as $key ) {
73 - $stash->getFile( $key, true );
74 - $stash->removeFileNoAuth( $key );
 73+ try {
 74+ $stash->getFile( $key, true );
 75+ $stash->removeFileNoAuth( $key );
 76+ } catch ( UploadStashBadPathException $ex ) {
 77+ $this->output( 'Failed removing stashed upload with key:' . $key );
 78+ continue;
 79+ }
7580 }
7681 }
7782 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r109435MFT r109433reedy21:24, 18 January 2012
r109438Add __METHOD__ to begin/commit...reedy21:27, 18 January 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   01:23, 19 January 2012

Why the 'continue', it doesn't do anything else each iteration?

#Comment by Reedy (talk | contribs)   01:29, 19 January 2012

Lol. Force of habit I think...

Status & tagging log