From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/db/LoadBalancer.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'includes/db/LoadBalancer.php') diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 0b8ef05a..083b70b3 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -809,7 +809,7 @@ class LoadBalancer { foreach ( $this->mConns as $conns2 ) { foreach ( $conns2 as $conns3 ) { foreach ( $conns3 as $conn ) { - $conn->immediateCommit(); + $conn->commit(); } } } @@ -831,7 +831,7 @@ class LoadBalancer { } } - function waitTimeout( $value = NULL ) { + function waitTimeout( $value = null ) { return wfSetVar( $this->mWaitTimeout, $value ); } @@ -878,14 +878,18 @@ class LoadBalancer { * Get the hostname and lag time of the most-lagged slave. * This is useful for maintenance scripts that need to throttle their updates. * May attempt to open connections to slaves on the default DB. + * @param $wiki string Wiki ID, or false for the default database */ - function getMaxLag() { + function getMaxLag( $wiki = false ) { $maxLag = -1; $host = ''; foreach ( $this->mServers as $i => $conn ) { - $conn = $this->getAnyOpenConnection( $i ); + $conn = false; + if ( $wiki === false ) { + $conn = $this->getAnyOpenConnection( $i ); + } if ( !$conn ) { - $conn = $this->openConnection( $i ); + $conn = $this->openConnection( $i, $wiki ); } if ( !$conn ) { continue; @@ -912,4 +916,11 @@ class LoadBalancer { $this->mLagTimes = $this->getLoadMonitor()->getLagTimes( array_keys( $this->mServers ), $wiki ); return $this->mLagTimes; } + + /** + * Clear the cache for getLagTimes + */ + function clearLagTimeCache() { + $this->mLagTimes = null; + } } -- cgit v1.2.3-54-g00ecf