X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2FrunJobs.php;h=9354e4fb6c3b41f075bab1bc8b6ca6a8eba0c1e8;hb=e77e1bcbf7ab008b071a15230654f4ca9a912df8;hp=51c52be61997bffdfe531e6f3c39ab07b4ef468d;hpb=4eff5204d9ec6eb09df70d2fe017a2146cfa4238;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; }