<?php
+use MediaWiki\MediaWikiServices;
+
/**
* @group JobQueue
* @group medium
}
$baseConfig = $wgJobTypeConf[$name];
} else {
- $baseConfig = [ 'class' => 'JobQueueDB' ];
+ $baseConfig = [ 'class' => 'JobQueueDBSingle' ];
}
$baseConfig['type'] = 'null';
$baseConfig['wiki'] = wfWikiID();
[ 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 1, 'i' => $i ] + $rootJob );
}
}
+
+class JobQueueDBSingle extends JobQueueDB {
+ protected function getDB( $index ) {
+ $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
+ // Override to not use CONN_TRX_AUTO so that we see the same temporary `job` table
+ return $lb->getConnection( $index, [], $this->wiki );
+ }
+}