Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354392 )

Change subject: Skip connecting to wiki if connection error
......................................................................

Skip connecting to wiki if connection error

It's probably wikitech, so we don't care about it

Change-Id: I5cb4222f64cb28306ffa074cfdc996541283ccdc
---
M makeSizeDBLists.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/92/354392/1

diff --git a/makeSizeDBLists.php b/makeSizeDBLists.php
index 927d7a7..e168c2d 100644
--- a/makeSizeDBLists.php
+++ b/makeSizeDBLists.php
@@ -22,8 +22,13 @@
                $medium = array();
                $large = array();
                foreach ( $wgConf->getLocalDatabases() as $wiki ) {
-                       $lb = wfGetLB( $wiki );
-                       $db = $lb->getConnection( DB_MASTER, array(), $wiki );
+                       try {
+                               $lb = wfGetLB( $wiki );
+                               $db = $lb->getConnection( DB_MASTER, array(), 
$wiki );
+                       } catch ( Exception $e ) {
+                               // Probably just wikitech etc, skip!
+                               continue;
+                       }
                        $count = intval( $db->selectField( 'site_stats', 
'ss_total_pages', '', __METHOD__ ) );
                        if ( $count < self::DB_SMALL ) {
                                $small[] = $wiki;

-- 
To view, visit https://gerrit.wikimedia.org/r/354392
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cb4222f64cb28306ffa074cfdc996541283ccdc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to