diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 20:21:25 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 20:21:25 +0000 |
commit | d81f562b712f2387fa02290bf2ca86392ab356f2 (patch) | |
tree | d666cdefbe6ac320827a2c6cb473581b46e22c4c /maintenance/runJobs.php | |
parent | 183851b06bd6c52f3cae5375f433da720d410447 (diff) |
Aktualisierung auf Version 1.8.1
Diffstat (limited to 'maintenance/runJobs.php')
-rw-r--r-- | maintenance/runJobs.php | 12 |
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; + } } } ?> |