summaryrefslogtreecommitdiff
path: root/includes/db/LoadBalancer.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /includes/db/LoadBalancer.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/db/LoadBalancer.php')
-rw-r--r--includes/db/LoadBalancer.php21
1 files changed, 16 insertions, 5 deletions
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;
+ }
}