summaryrefslogtreecommitdiff
path: root/maintenance/runJobs.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2006-10-11 20:21:25 +0000
committerPierre Schmitz <pierre@archlinux.de>2006-10-11 20:21:25 +0000
commitd81f562b712f2387fa02290bf2ca86392ab356f2 (patch)
treed666cdefbe6ac320827a2c6cb473581b46e22c4c /maintenance/runJobs.php
parent183851b06bd6c52f3cae5375f433da720d410447 (diff)
Aktualisierung auf Version 1.8.1
Diffstat (limited to 'maintenance/runJobs.php')
-rw-r--r--maintenance/runJobs.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php
index d72addc7..343cda8a 100644
--- a/maintenance/runJobs.php
+++ b/maintenance/runJobs.php
@@ -1,13 +1,22 @@
<?php
+$optionsWithArgs = array( 'maxjobs' );
+$wgUseNormalUser = true;
require_once( 'commandLine.inc' );
require_once( "$IP/includes/JobQueue.php" );
require_once( "$IP/includes/FakeTitle.php" );
+if ( isset( $options['maxjobs'] ) ) {
+ $maxJobs = $options['maxjobs'];
+} else {
+ $maxJobs = 10000;
+}
+
// Trigger errors on inappropriate use of $wgTitle
$wgTitle = new FakeTitle;
$dbw =& wfGetDB( DB_MASTER );
+$n = 0;
while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
while ( false != ($job = Job::pop()) ) {
wfWaitForSlaves( 5 );
@@ -15,6 +24,9 @@ while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
if ( !$job->run() ) {
print "Error: {$job->error}\n";
}
+ if ( $maxJobs && ++$n > $maxJobs ) {
+ break 2;
+ }
}
}
?>