* @file
* @author Aaron Schulz
*/
+use MediaWiki\MediaWikiServices;
/**
* Class to handle job queues stored in the DB
* @return void
*/
protected function doWaitForBackups() {
- wfWaitForSlaves( false, $this->wiki, $this->cluster ?: false );
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lbFactory->waitForReplication( [ 'wiki' => $this->wiki, 'cluster' => $this->cluster ] );
}
/**
* @return DBConnRef
*/
protected function getDB( $index ) {
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$lb = ( $this->cluster !== false )
- ? wfGetLBFactory()->getExternalLB( $this->cluster, $this->wiki )
- : wfGetLB( $this->wiki );
+ ? $lbFactory->getExternalLB( $this->cluster, $this->wiki )
+ : $lbFactory->getMainLB( $this->wiki );
return $lb->getConnectionRef( $index, [], $this->wiki );
}