Use wfGetLB()->getServerCount() to get the server count, not $wgDBservers
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 10 Oct 2010 12:20:53 +0000 (12:20 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 10 Oct 2010 12:20:53 +0000 (12:20 +0000)
maintenance/fixSlaveDesync.php

index 321c041..0d91f54 100644 (file)
@@ -28,9 +28,8 @@ class FixSlaveDesync extends Maintenance {
        }
        
        public function execute() {
-               global $wgDBservers;
                $this->slaveIndexes = array();
-               for ( $i = 1; $i < count( $wgDBservers ); $i++ ) {
+               for ( $i = 1; $i < wfGetLB()->getServerCount(); $i++ ) {
                        if ( wfGetLB()->isNonZeroLoad( $i ) ) {
                                $this->slaveIndexes[] = $i;
                        }