From: Aaron Schulz Date: Sat, 3 Sep 2016 21:58:38 +0000 (-0700) Subject: Remove unused DB position values in LoadBalancer X-Git-Tag: 1.31.0-rc.0~5763^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=d9f35c8240af1a3b88165479f09dde6458e9f174;p=lhc%2Fweb%2Fwiklou.git Remove unused DB position values in LoadBalancer Also fixed IDEA error about useless $conn declaration. Change-Id: I73572cb201e44db45fbe9bdb8e06bff4b50cecb2 --- diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 7ca0b33e8d..d3a2902a00 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -284,7 +284,6 @@ class LoadBalancer { # No server found yet $i = false; - $conn = false; # First try quickly looking through the available servers for a server that # meets our criteria $currentLoads = $nonErrorLoads; @@ -353,9 +352,7 @@ class LoadBalancer { # Replica DB connection successful. # Wait for the session master pos for a short time. if ( $this->mWaitForPos && $i > 0 ) { - if ( !$this->doWait( $i ) ) { - $this->mServers[$i]['slave pos'] = $conn->getSlavePos(); - } + $this->doWait( $i ); } if ( $this->mReadIndex <= 0 && $this->mLoads[$i] > 0 && $group === false ) { $this->mReadIndex = $i; @@ -384,7 +381,6 @@ class LoadBalancer { if ( $i > 0 ) { if ( !$this->doWait( $i ) ) { - $this->mServers[$i]['slave pos'] = $this->getAnyOpenConnection( $i )->getSlavePos(); $this->laggedReplicaMode = true; } }