From: addshore Date: Fri, 4 Oct 2013 18:32:16 +0000 (+0200) Subject: Remove use of deprecated LoadBalancer pickRandom X-Git-Tag: 1.31.0-rc.0~18600 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=a6169910ea1e9e63b83595f06f444cde8cb2bfcd;p=lhc%2Fweb%2Fwiklou.git Remove use of deprecated LoadBalancer pickRandom Change-Id: If28b6dfe7d70827d1c7f7b3604cea2409b6ec483 --- diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 3358488c25..857109db26 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -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; } }