Replace usage of wfWaitForSlaves()

Bug: T181673
Change-Id: I3d2c1e7421b71364e01f00c5445cebc9c65326d4
This commit is contained in:
Reedy
2020-06-06 17:41:39 +01:00
parent 349bdf5f12
commit 5fea24f67c

View File

@@ -13,6 +13,8 @@
* @ingroup Maintenance
*/
use MediaWiki\MediaWikiServices;
require_once getenv( 'MW_INSTALL_PATH' ) !== false
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
: __DIR__ . '/../../../maintenance/Maintenance.php';
@@ -32,6 +34,7 @@ class ULSCompactLinksDisablePref extends Maintenance {
public function execute() {
$dbr = wfGetDB( DB_REPLICA, 'vslow' );
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$really = $this->hasOption( 'really' );
@@ -110,7 +113,7 @@ class ULSCompactLinksDisablePref extends Maintenance {
}
$this->output( "Disabled compact-language-links for $disabled users.\n" );
wfWaitForSlaves();
$lbFactory->waitForReplication();
} while ( $results->numRows() === $this->mBatchSize );
$this->output( "done.\n" );