From 97dcbc1c26ee75f81b979f935f98c751b9380fd0 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 4 Apr 2013 16:10:56 -0700 Subject: [PATCH] Added "cluster" parameter to wfWaitForSlaves() for external DBs. Change-Id: I226a1793dfb901de8e1c0ac40c1dc3ad890de95a --- includes/GlobalFunctions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 ) { -- 2.20.1