use MediaWiki\MediaWikiServices;
use MediaWiki\Logger\LoggerFactory;
-use Liuggio\StatsdClient\Factory\StatsdDataFactory;
+use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Wikimedia\ScopedCallback;
}
/**
- * @param Job $job
+ * @param RunnableJob $job
* @param LBFactory $lbFactory
- * @param StatsdDataFactory $stats
+ * @param StatsdDataFactoryInterface $stats
* @param float $popTime
* @return array Map of status/error/timeMs
*/
- private function executeJob( Job $job, LBFactory $lbFactory, $stats, $popTime ) {
+ private function executeJob( RunnableJob $job, LBFactory $lbFactory, $stats, $popTime ) {
$jType = $job->getType();
$msg = $job->toString() . " STARTING";
$this->logger->debug( $msg, [
}
/**
- * @param Job $job
+ * @param RunnableJob $job
* @return int Seconds for this runner to avoid doing more jobs of this type
* @see $wgJobBackoffThrottling
*/
- private function getBackoffTimeToWait( Job $job ) {
+ private function getBackoffTimeToWait( RunnableJob $job ) {
$throttling = $this->config->get( 'JobBackoffThrottling' );
if ( !isset( $throttling[$job->getType()] ) || $job instanceof DuplicateJob ) {
* $wgJobSerialCommitThreshold for more.
*
* @param LBFactory $lbFactory
- * @param Job $job
+ * @param RunnableJob $job
* @param string $fnameTrxOwner
* @throws DBError
*/
- private function commitMasterChanges( LBFactory $lbFactory, Job $job, $fnameTrxOwner ) {
+ private function commitMasterChanges( LBFactory $lbFactory, RunnableJob $job, $fnameTrxOwner ) {
$syncThreshold = $this->config->get( 'JobSerialCommitThreshold' );
$time = false;
$lb = $lbFactory->getMainLB();
- if ( $syncThreshold !== false && $lb->getServerCount() > 1 ) {
+ if ( $syncThreshold !== false && $lb->hasStreamingReplicaServers() ) {
// Generally, there is one master connection to the local DB
$dbwSerial = $lb->getAnyOpenConnection( $lb->getWriterIndex() );
// We need natively blocking fast locks