3 * This script starts pending jobs.
6 * --maxjobs <num> (default 10000)
10 * @ingroup Maintenance
13 $optionsWithArgs = array( 'maxjobs', 'type' );
14 $wgUseNormalUser = true;
15 require_once( 'commandLine.inc' );
16 require_once( "$IP/includes/JobQueue.php" );
17 require_once( "$IP/includes/FakeTitle.php" );
19 if ( isset( $options['maxjobs'] ) ) {
20 $maxJobs = $options['maxjobs'];
26 if ( isset( $options['type'] ) )
27 $type = $options['type'];
29 $wgTitle = Title
::newFromText( 'RunJobs.php' );
31 $dbw = wfGetDB( DB_MASTER
);
35 $conds = "job_cmd = " . $dbw->addQuotes($type);
37 while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) {
40 $job = ($type == false) ?
42 : Job
::pop_type($type);
48 print wfTimestamp( TS_DB
) . " " . $job->id
. " " . $job->toString() . "\n";
51 print wfTimestamp( TS_DB
) . " Error: {$job->error}\n";
53 if ( $maxJobs && ++
$n > $maxJobs ) {