summaryrefslogtreecommitdiff
path: root/maintenance/runJobs.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /maintenance/runJobs.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
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
Diffstat (limited to 'maintenance/runJobs.php')
-rw-r--r--maintenance/runJobs.php24
1 files changed, 18 insertions, 6 deletions
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 @@
<?php
/**
- * This script starts pending jobs.
+ * Run pending jobs.
*
- * Usage:
+ * Options:
* --maxjobs <num> (default 10000)
* --type <job_cmd>
*
@@ -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 );