X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrunJobs.php;h=9354e4fb6c3b41f075bab1bc8b6ca6a8eba0c1e8;hb=388bbf3f7baefea02f9c89c4ade958059fa4282d;hp=9f5f1afd2378843e02045ab4db8af83cb99153f7;hpb=66cebd0be71aa7fa9cd3f5b12db6108563f3d30e;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;