Localisation updates from http://translatewiki.net.
[lhc/web/wiklou.git] / maintenance / runJobs.php
index 9c1ad29..af7c906 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * This script starts pending jobs.
+ * Run pending jobs.
  *
- * Usage:
+ * Options:
  *  --maxjobs <num> (default 10000)
  *  --type <job_cmd>
  *
  * 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' );
 
+/**
+ * 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,11 +69,11 @@ class RunJobs extends Maintenance {
                $wgTitle = Title::newFromText( 'RunJobs.php' );
                $dbw = wfGetDB( DB_MASTER );
                $n = 0;
-               $conds = '';
+
                if ( $type === false ) {
                        $conds = Job::defaultQueueConditions( );
                } else {
-                       $conds = "job_cmd = " . $dbw->addQuotes( $type );
+                       $conds = array( 'job_cmd' => $type );
                }
 
                while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) {