* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @author Aaron Schulz
*/
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\DBConnRef;
* @return void
*/
protected function doBatchPush( array $jobs, $flags ) {
- DeferredUpdates::addUpdate( new AutoCommitUpdate(
- wfGetDB( DB_MASTER ),
- __METHOD__,
- function ( IDatabase $dbw, $fname ) use ( $jobs, $flags ) {
- $this->doBatchPushInternal( $dbw, $jobs, $flags, $fname );
- }
- ) );
+ DeferredUpdates::addUpdate(
+ new AutoCommitUpdate(
+ $this->getMasterDB(),
+ __METHOD__,
+ function ( IDatabase $dbw, $fname ) use ( $jobs, $flags ) {
+ $this->doBatchPushInternal( $dbw, $jobs, $flags, $fname );
+ }
+ ),
+ DeferredUpdates::PRESEND
+ );
}
/**
protected function getDB( $index ) {
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$lb = ( $this->cluster !== false )
- ? $lbFactory->getExternalLB( $this->cluster, $this->wiki )
+ ? $lbFactory->getExternalLB( $this->cluster )
: $lbFactory->getMainLB( $this->wiki );
return $lb->getConnectionRef( $index, [], $this->wiki );