specify offset for Job::pop(), yay for efficient job queue runs (unless there's a...
authorDomas Mituzas <midom@users.mediawiki.org>
Sun, 25 Mar 2007 16:01:12 +0000 (16:01 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Sun, 25 Mar 2007 16:01:12 +0000 (16:01 +0000)
maintenance/runJobs.php

index 7f7ed9a..91168e5 100644 (file)
@@ -17,9 +17,11 @@ $wgTitle = Title::newFromText( 'RunJobs.php' );
 $dbw = wfGetDB( DB_MASTER );
 $n = 0;
 while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
-       while ( false != ($job = Job::pop()) ) {
+       $offset=0;
+       while ( false != ($job = Job::pop($offset)) ) {
                wfWaitForSlaves( 5 );
                print $job->id . "  " . $job->toString() . "\n";
+               $offset=$job->id;
                if ( !$job->run() ) {
                        print "Error: {$job->error}\n";
                }