summaryrefslogtreecommitdiff
path: root/includes/db/LoadBalancer.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/db/LoadBalancer.php')
-rw-r--r--includes/db/LoadBalancer.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php
index e96c6720..0e455e0c 100644
--- a/includes/db/LoadBalancer.php
+++ b/includes/db/LoadBalancer.php
@@ -1,6 +1,21 @@
<?php
/**
- * Database load balancing
+ * Database load balancing.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
*
* @file
* @ingroup Database
@@ -91,7 +106,7 @@ class LoadBalancer {
/**
* Get or set arbitrary data used by the parent object, usually an LBFactory
* @param $x
- * @return \Mixed
+ * @return Mixed
*/
function parentInfo( $x = null ) {
return wfSetVar( $this->mParentInfo, $x );
@@ -385,7 +400,7 @@ class LoadBalancer {
* Returns false if there is no connection open
*
* @param $i int
- * @return DatabaseBase|false
+ * @return DatabaseBase|bool False on failure
*/
function getAnyOpenConnection( $i ) {
foreach ( $this->mConns as $conns ) {
@@ -894,7 +909,7 @@ class LoadBalancer {
foreach ( $this->mConns as $conns2 ) {
foreach ( $conns2 as $conns3 ) {
foreach ( $conns3 as $conn ) {
- $conn->commit();
+ $conn->commit( __METHOD__ );
}
}
}
@@ -911,7 +926,7 @@ class LoadBalancer {
continue;
}
foreach ( $conns2[$masterIndex] as $conn ) {
- if ( $conn->doneWrites() ) {
+ if ( $conn->writesOrCallbacksPending() ) {
$conn->commit( __METHOD__ );
}
}