Added "cluster" parameter to wfWaitForSlaves() for external DBs.
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 4 Apr 2013 23:10:56 +0000 (16:10 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 4 Apr 2013 23:10:56 +0000 (16:10 -0700)
Change-Id: I226a1793dfb901de8e1c0ac40c1dc3ad890de95a

includes/GlobalFunctions.php

index 7d54cb8..033abf9 100644 (file)
@@ -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 ) {