X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FrunJobs.php;h=e909bc06ae173cc5b0a675f241f9367b495cfa08;hb=be661ebe7c1017b61c02fb54e14dccba3c511a79;hp=9c1ad29a9a67c9779815b3de52b76173432c50fc;hpb=73994ed5968b127eead3f0f0d6571c289b557abe;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 9c1ad29a9a..e909bc06ae 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,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' ) ) {