From: Aaron Schulz Date: Fri, 13 Nov 2015 08:07:14 +0000 (-0800) Subject: Clean up some wfDebug() calls in LoadBalancer X-Git-Tag: 1.31.0-rc.0~8990 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=da6afd88999c129aca43c40100390f07d00f4f84;p=lhc%2Fweb%2Fwiklou.git Clean up some wfDebug() calls in LoadBalancer Change-Id: I01143bec5b084a32c3edd836d194c0a17ca0e43c --- diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index afd4ba86f1..19b2d1cdd4 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -208,8 +208,6 @@ class LoadBalancer { return false; } - # wfDebugLog( 'connect', var_export( $loads, true ) ); - # Return a random representative of the remainder return ArrayUtils::pickRandom( $loads ); } @@ -247,7 +245,7 @@ class LoadBalancer { $nonErrorLoads = $this->mGroupLoads[$group]; } else { # No loads for this group, return false and the caller can use some other group - wfDebug( __METHOD__ . ": no loads for group $group\n" ); + wfDebugLog( 'connect', __METHOD__ . ": no loads for group $group\n" ); return false; } @@ -347,7 +345,8 @@ class LoadBalancer { } } $serverName = $this->getServerName( $i ); - wfDebug( __METHOD__ . ": using server $serverName for group '$group'\n" ); + wfDebugLog( 'connect', __METHOD__ . + ": using server $serverName for group '$group'\n" ); } return $i; @@ -686,10 +685,10 @@ class LoadBalancer { $conn = $this->reallyOpenConnection( $server, false ); $serverName = $this->getServerName( $i ); if ( $conn->isOpen() ) { - wfDebug( "Connected to database $i at $serverName\n" ); + wfDebugLog( 'connect', "Connected to database $i at $serverName\n" ); $this->mConns['local'][$i][0] = $conn; } else { - wfDebug( "Failed to connect to database $i at $serverName\n" ); + wfDebugLog( 'connect', "Failed to connect to database $i at $serverName\n" ); $this->mErrorConnection = $conn; $conn = false; } @@ -964,14 +963,10 @@ class LoadBalancer { for ( $i = 1; $i < $serverCount; $i++ ) { $conn = $this->getAnyOpenConnection( $i ); if ( $conn ) { - wfDebug( "Master pos fetched from slave\n" ); - return $conn->getSlavePos(); } } } else { - wfDebug( "Master pos fetched from master\n" ); - return $masterConn->getMasterPos(); }