From bd649e656668b6faf32a54281af2c6400986655a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 3 Mar 2015 12:20:12 -0800 Subject: [PATCH] Made JobRunner bail sooner for bogus job --type parameters Change-Id: I1259682b8a6543e76f1c9a4d99324b457115a277 --- includes/jobqueue/JobRunner.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index 091e648d7a..edb491159d 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -87,6 +87,8 @@ class JobRunner implements LoggerAwareInterface { * @return array Summary response that can easily be JSON serialized */ public function run( array $options ) { + global $wgJobClasses; + $response = array( 'jobs' => array(), 'reached' => 'none-ready' ); $type = isset( $options['type'] ) ? $options['type'] : false; @@ -94,6 +96,11 @@ class JobRunner implements LoggerAwareInterface { $maxTime = isset( $options['maxTime'] ) ? $options['maxTime'] : false; $noThrottle = isset( $options['throttle'] ) && !$options['throttle']; + if ( $type !== false && !isset( $wgJobClasses[$type] ) ) { + $response['reached'] = 'none-possible'; + return $response; + } + $group = JobQueueGroup::singleton(); // Handle any required periodic queue maintenance $count = $group->executeReadyPeriodicTasks(); -- 2.20.1