From: Alexandre Emsenhuber Date: Sun, 10 Oct 2010 11:39:08 +0000 (+0000) Subject: Use the load balancer to get the server count, not $wgServers X-Git-Tag: 1.31.0-rc.0~34551 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=540efd5e6c2b599294c040d34cc940cd706e23af;p=lhc%2Fweb%2Fwiklou.git Use the load balancer to get the server count, not $wgServers --- diff --git a/maintenance/initEditCount.php b/maintenance/initEditCount.php index b95ef7bb08..a526081e97 100644 --- a/maintenance/initEditCount.php +++ b/maintenance/initEditCount.php @@ -34,12 +34,11 @@ class InitEditCount extends Maintenance { Background mode will be automatically used if the server is MySQL 4.0 (which does not support subqueries) or if multiple servers are listed -in $wgDBservers, usually indicating a replication environment.' ); +in the load balancer, usually indicating a replication environment.' ); $this->mDescription = "Batch-recalculate user_editcount fields from the revision table"; } public function execute() { - global $wgDBservers; $dbw = wfGetDB( DB_MASTER ); $user = $dbw->tableName( 'user' ); $revision = $dbw->tableName( 'revision' ); @@ -47,7 +46,7 @@ in $wgDBservers, usually indicating a replication environment.' ); $dbver = $dbw->getServerVersion(); // Autodetect mode... - $backgroundMode = count( $wgDBservers ) > 1 || + $backgroundMode = wfGetLB()->getServerCount() > 1 || ( $dbw instanceof DatabaseMysql && version_compare( $dbver, '4.1' ) < 0 ); if ( $this->hasOption( 'background' ) ) {