Remove use of deprecated LoadBalancer pickRandom
authoraddshore <addshorewiki@gmail.com>
Fri, 4 Oct 2013 18:32:16 +0000 (20:32 +0200)
committeraddshore <addshorewiki@gmail.com>
Fri, 4 Oct 2013 18:38:45 +0000 (20:38 +0200)
Change-Id: If28b6dfe7d70827d1c7f7b3604cea2409b6ec483

includes/db/LoadBalancer.php

index 3358488..857109d 100644 (file)
@@ -167,7 +167,7 @@ class LoadBalancer {
                #wfDebugLog( 'connect', var_export( $loads, true ) );
 
                # Return a random representative of the remainder
-               return $this->pickRandom( $loads );
+               return ArrayUtils::pickRandom( $loads );
        }
 
        /**
@@ -236,7 +236,7 @@ class LoadBalancer {
                        $currentLoads = $nonErrorLoads;
                        while ( count( $currentLoads ) ) {
                                if ( $wgReadOnly || $this->mAllowLagged || $laggedSlaveMode ) {
-                                       $i = $this->pickRandom( $currentLoads );
+                                       $i = ArrayUtils::pickRandom( $currentLoads );
                                } else {
                                        $i = $this->getRandomNonLagged( $currentLoads, $wiki );
                                        if ( $i === false && count( $currentLoads ) != 0 ) {
@@ -244,7 +244,7 @@ class LoadBalancer {
                                                wfDebugLog( 'replication', "All slaves lagged. Switch to read-only mode\n" );
                                                $wgReadOnly = 'The database has been automatically locked ' .
                                                        'while the slave database servers catch up to the master';
-                                               $i = $this->pickRandom( $currentLoads );
+                                               $i = ArrayUtils::pickRandom( $currentLoads );
                                                $laggedSlaveMode = true;
                                        }
                                }