X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrunJobs.php;h=0874538b19bc06d315e07b6cebf23099191e14bc;hb=3d95da4952619f9f773298c4461ccfc646fb18a9;hp=2e011fecde54b2f356e9fdb1aed7b43f2192a5c8;hpb=61898ad28ed69c5b391eb43e0db9386279b9612c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 2e011fecde..0874538b19 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -25,6 +25,9 @@ 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. * @@ -39,7 +42,7 @@ class RunJobs extends Maintenance { $this->addOption( 'type', 'Type of job to run', false, true ); $this->addOption( 'procs', 'Number of processes to use', false, true ); $this->addOption( 'nothrottle', 'Ignore job throttling configuration', false, false ); - $this->addOption( 'result', 'Set to JSON to print only a JSON response', false, true ); + $this->addOption( 'result', 'Set to "json" to print only a JSON response', false, true ); $this->addOption( 'wait', 'Wait for new jobs instead of exiting', false, false ); } @@ -56,7 +59,7 @@ class RunJobs extends Maintenance { if ( $this->hasOption( 'procs' ) ) { $procs = intval( $this->getOption( 'procs' ) ); if ( $procs < 1 || $procs > 1000 ) { - $this->error( "Invalid argument to --procs", true ); + $this->fatalError( "Invalid argument to --procs" ); } elseif ( $procs != 1 ) { $fc = new ForkController( $procs ); if ( $fc->start() != 'child' ) {