jobsByDomain[$domain] = $jobs; // TODO Inject services, when DeferredUpdates supports DI $this->jobQueueGroupFactory = MediaWikiServices::getInstance()->getJobQueueGroupFactory(); } /** @inheritDoc */ public function merge( MergeableUpdate $update ) { /** @var self $update */ Assert::parameterType( __CLASS__, $update, '$update' ); '@phan-var self $update'; foreach ( $update->jobsByDomain as $domain => $jobs ) { $this->jobsByDomain[$domain] = array_merge( $this->jobsByDomain[$domain] ?? [], $jobs ); } } /** @inheritDoc */ public function doUpdate() { foreach ( $this->jobsByDomain as $domain => $jobs ) { $group = $this->jobQueueGroupFactory->makeJobQueueGroup( $domain ); try { $group->push( $jobs ); } catch ( Throwable $e ) { // Get in as many jobs as possible and let other post-send updates happen MWExceptionHandler::logException( $e ); } } } } /** @deprecated since 1.42 */ class_alias( JobQueueEnqueueUpdate::class, 'JobQueueEnqueueUpdate' );