X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrunJobs.php;h=9354e4fb6c3b41f075bab1bc8b6ca6a8eba0c1e8;hb=388bbf3f7baefea02f9c89c4ade958059fa4282d;hp=51c52be61997bffdfe531e6f3c39ab07b4ef468d;hpb=c2adecb31b16a36efdb509a575533c7f103a0576;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 51c52be619..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. * @@ -99,6 +102,10 @@ class RunJobs extends Maintenance { $response['reached'] === 'job-limit' || $response['reached'] === 'memory-limit' ) { + // If job queue is empty, output it + if ( !$outputJSON && $response['jobs'] === [] ) { + $this->output( "Job queue is empty.\n" ); + } break; }