From: Tim Starling Date: Sat, 3 Jan 2009 00:17:23 +0000 (+0000) Subject: Gracefully skip clusters that don't have the wiki in question X-Git-Tag: 1.31.0-rc.0~43596 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=853b9bb141952acf78086513cfaafb7e1a6d1cbb;p=lhc%2Fweb%2Fwiklou.git Gracefully skip clusters that don't have the wiki in question --- diff --git a/maintenance/storage/trackBlobs.php b/maintenance/storage/trackBlobs.php index 1b95b21e4d..b13faa003a 100644 --- a/maintenance/storage/trackBlobs.php +++ b/maintenance/storage/trackBlobs.php @@ -249,7 +249,16 @@ class TrackBlobs { foreach ( $this->clusters as $cluster ) { echo "Searching for orphan blobs in $cluster...\n"; $lb = wfGetLBFactory()->getExternalLB( $cluster ); - $extDB = $lb->getConnection( DB_SLAVE ); + try { + $extDB = $lb->getConnection( DB_SLAVE ); + } catch ( DBConnectionError $e ) { + if ( strpos( $e->error, 'Unknown database' ) !== false ) { + echo "No database on $cluster\n"; + } else { + echo "Error on $cluster: " . $e->getMessage() . "\n"; + } + continue; + } $startId = 0; $batchesDone = 0; $actualBlobs = gmp_init( 0 );