From: Aaron Schulz Date: Tue, 4 Oct 2016 11:16:21 +0000 (-0700) Subject: Add missing array_keys() call to scaleLoads() X-Git-Tag: 1.31.0-rc.0~5223 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=4a8ddb9d0f137ac8795117d0fb42f753c7561aa3;p=lhc%2Fweb%2Fwiklou.git Add missing array_keys() call to scaleLoads() Bug: T147240 Change-Id: I110f43b5990fe42b2d7f1ec960a55a1ae4aa4253 --- diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php b/includes/libs/rdbms/loadmonitor/LoadMonitor.php index dddc7b063a..59075e483e 100644 --- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php +++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php @@ -58,7 +58,8 @@ class LoadMonitor implements ILoadMonitor { } public function scaleLoads( array &$weightByServer, $group = false, $domain = false ) { - $states = $this->getServerStates( $weightByServer, $domain ); + $serverIndexes = array_keys( $weightByServer ); + $states = $this->getServerStates( $serverIndexes, $domain ); $coefficientsByServer = $states['weightScales']; foreach ( $weightByServer as $i => $weight ) { $weightByServer[$i] = $weight * $coefficientsByServer[$i];