From: Aaron Schulz Date: Thu, 4 Apr 2013 23:10:56 +0000 (-0700) Subject: Added "cluster" parameter to wfWaitForSlaves() for external DBs. X-Git-Tag: 1.31.0-rc.0~20094^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=97dcbc1c26ee75f81b979f935f98c751b9380fd0;p=lhc%2Fweb%2Fwiklou.git Added "cluster" parameter to wfWaitForSlaves() for external DBs. Change-Id: I226a1793dfb901de8e1c0ac40c1dc3ad890de95a --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7d54cb83ed..033abf9c85 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3619,9 +3619,12 @@ function wfGetNull() { * * @param $maxLag Integer (deprecated) * @param $wiki mixed Wiki identifier accepted by wfGetLB + * @param $cluster string cluster name accepted by LBFactory */ -function wfWaitForSlaves( $maxLag = false, $wiki = false ) { - $lb = wfGetLB( $wiki ); +function wfWaitForSlaves( $maxLag = false, $wiki = false, $cluster = false ) { + $lb = ( $cluster !== false ) + ? wfGetLBFactory()->getExternalLB( $cluster ) + : wfGetLB( $wiki ); // bug 27975 - Don't try to wait for slaves if there are none // Prevents permission error when getting master position if ( $lb->getServerCount() > 1 ) {