/**
* Acknowledge that a job was completed
*
- * @param Job $job
+ * @param RunnableJob $job
* @return void
*/
- public function ack( Job $job ) {
+ public function ack( RunnableJob $job ) {
$this->get( $job->getType() )->ack( $job );
}
* Register the "root job" of a given job into the queue for de-duplication.
* This should only be called right *after* all the new jobs have been inserted.
*
- * @param Job $job
+ * @param RunnableJob $job
* @return bool
*/
- public function deduplicateRootJob( Job $job ) {
+ public function deduplicateRootJob( RunnableJob $job ) {
return $this->get( $job->getType() )->deduplicateRootJob( $job );
}
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;