From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- maintenance/runJobs.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'maintenance/runJobs.php') diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 6068311e..e909bc06 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -1,8 +1,8 @@ (default 10000) * --type * @@ -21,11 +21,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once( __DIR__ . '/Maintenance.php' ); +/** + * Maintenance script that runs pending jobs. + * + * @ingroup Maintenance + */ class RunJobs extends Maintenance { public function __construct() { parent::__construct(); @@ -37,6 +43,9 @@ class RunJobs extends Maintenance { } public function memoryLimit() { + if ( $this->hasOption( 'memory-limit' ) ) { + return parent::memoryLimit(); + } // Don't eat all memory on the machine if we get a bad job. return "150M"; } @@ -60,9 +69,11 @@ class RunJobs extends Maintenance { $wgTitle = Title::newFromText( 'RunJobs.php' ); $dbw = wfGetDB( DB_MASTER ); $n = 0; - $conds = ''; - if ( $type !== false ) { - $conds = "job_cmd = " . $dbw->addQuotes( $type ); + + if ( $type === false ) { + $conds = Job::defaultQueueConditions( ); + } else { + $conds = array( 'job_cmd' => $type ); } while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) { @@ -77,6 +88,7 @@ class RunJobs extends Maintenance { wfWaitForSlaves(); $t = microtime( true ); $offset = $job->id; + $this->runJobsLog( $job->toString() . " STARTING" ); $status = $job->run(); $t = microtime( true ) - $t; $timeMs = intval( $t * 1000 ); -- cgit v1.2.2