r45354 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45353‎ | r45354 | r45355 >
Date:00:17, 3 January 2009
Author:tstarling
Status:ok
Tags:
Comment:
Gracefully skip clusters that don't have the wiki in question
Modified paths:
  • /trunk/phase3/maintenance/storage/trackBlobs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/trackBlobs.php
@@ -249,7 +249,16 @@
250250 foreach ( $this->clusters as $cluster ) {
251251 echo "Searching for orphan blobs in $cluster...\n";
252252 $lb = wfGetLBFactory()->getExternalLB( $cluster );
253 - $extDB = $lb->getConnection( DB_SLAVE );
 253+ try {
 254+ $extDB = $lb->getConnection( DB_SLAVE );
 255+ } catch ( DBConnectionError $e ) {
 256+ if ( strpos( $e->error, 'Unknown database' ) !== false ) {
 257+ echo "No database on $cluster\n";
 258+ } else {
 259+ echo "Error on $cluster: " . $e->getMessage() . "\n";
 260+ }
 261+ continue;
 262+ }
254263 $startId = 0;
255264 $batchesDone = 0;
256265 $actualBlobs = gmp_init( 0 );

Status & tagging log