From 853b9bb141952acf78086513cfaafb7e1a6d1cbb Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 3 Jan 2009 00:17:23 +0000 Subject: [PATCH] Gracefully skip clusters that don't have the wiki in question --- maintenance/storage/trackBlobs.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ); -- 2.20.1