X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrunJobs.php;h=9354e4fb6c3b41f075bab1bc8b6ca6a8eba0c1e8;hb=efbfa0a727a196e63a2b71f0a82f09150c2be354;hp=9f5f1afd2378843e02045ab4db8af83cb99153f7;hpb=b8e0ca16aa743581f5fac5cef8bed5ac2bf6e7cb;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 9f5f1afd23..9354e4fb6c 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -21,13 +21,16 @@ * @ingroup Maintenance */ +if ( !defined( 'MEDIAWIKI' ) ) { + // So extensions (and other code) can check whether they're running in job mode. + // This is not defined if this script is included from installer/updater or phpunit. + define( 'MEDIAWIKI_JOB_RUNNER', true ); +} + require_once __DIR__ . '/Maintenance.php'; use MediaWiki\Logger\LoggerFactory; -// So extensions (and other code) can check whether they're running in job mode -define( 'MEDIAWIKI_JOB_RUNNER', true ); - /** * Maintenance script that runs pending jobs. * @@ -100,7 +103,7 @@ class RunJobs extends Maintenance { $response['reached'] === 'memory-limit' ) { // If job queue is empty, output it - if ( $response['jobs'] === [] ) { + if ( !$outputJSON && $response['jobs'] === [] ) { $this->output( "Job queue is empty.\n" ); } break;