Skip to content

Commit

Permalink
Check mwVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
hslater committed Nov 29, 2023
1 parent c1c9a05 commit 8364914
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() );
}
}

/**
Expand Down

0 comments on commit 8364914

Please sign in to comment.