Introduce $wiki parameter to wfWaitForSlaves in order to be able to wait for the...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 9 Nov 2009 11:38:52 +0000 (11:38 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 9 Nov 2009 11:38:52 +0000 (11:38 +0000)
includes/GlobalFunctions.php

index 60197ee..85bbabb 100644 (file)
@@ -3187,11 +3187,12 @@ function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
  * to use this outside maintenance scripts in its present form.
  *
  * @param $maxLag Integer
+ * @param $wiki mixed Wiki identifier accepted by wfGetLB
  * @return null
  */
-function wfWaitForSlaves( $maxLag ) {
+function wfWaitForSlaves( $maxLag, $wiki = false ) {
        if( $maxLag ) {
-               $lb = wfGetLB();
+               $lb = wfGetLB( $wiki );
                list( $host, $lag ) = $lb->getMaxLag();
                while( $lag > $maxLag ) {
                        $name = @gethostbyaddr( $host );