diff --git a/src/Runner.php b/src/Runner.php index 9d2b9cf..528fee2 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -6,6 +6,7 @@ use DateTime; use Exception; use GlobalVarConfig; +use JobQueueGroup; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; use MWStake\MediaWiki\Component\RunJobsTrigger\Job\InvokeRunner; @@ -129,8 +130,15 @@ public static function runDeferred() { return; } - MediaWikiServices::getInstance()->getJobQueueGroupFactory()->makeJobQueueGroup() - ->push( new InvokeRunner() ); + $services = MediaWikiServices::getInstance(); + $config = $services->getMainConfig(); + $mwVersion = $config->get( 'Version' ); + if ( version_compare( $mwVersion, '1.35', '>=' ) ) { + $services->getJobQueueGroupFactory()->makeJobQueueGroup() + ->push( new InvokeRunner() ); + } else { + JobQueueGroup::singleton()->push( new InvokeRunner() ); + } } /**