summaryrefslogtreecommitdiff
path: root/maintenance/runJobs.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/runJobs.php')
-rw-r--r--maintenance/runJobs.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php
index 91168e59..4539be05 100644
--- a/maintenance/runJobs.php
+++ b/maintenance/runJobs.php
@@ -12,13 +12,28 @@ if ( isset( $options['maxjobs'] ) ) {
$maxJobs = 10000;
}
+$type = false;
+if ( isset( $options['type'] ) )
+ $type = $options['type'];
+
$wgTitle = Title::newFromText( 'RunJobs.php' );
$dbw = wfGetDB( DB_MASTER );
$n = 0;
-while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
+$conds = array();
+if ($type !== false)
+ $conds = array('job_cmd' => $type);
+
+while ( $dbw->selectField( 'job', 'count(*)', $conds, 'runJobs.php' ) ) {
$offset=0;
- while ( false != ($job = Job::pop($offset)) ) {
+ for (;;) {
+ $job = ($type == false) ?
+ Job::pop($offset, $type)
+ : Job::pop_type($type);
+
+ if ($job == false)
+ break;
+
wfWaitForSlaves( 5 );
print $job->id . " " . $job->toString() . "\n";
$offset=$job->id;
@@ -30,4 +45,4 @@ while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
}
}
}
-?>
+