* on each job runner process. The meaning of "work items" varies per job,
* but typically would be something like "pages to update". A single job
* may have a variable number of work items, as is the case with batch jobs.
+ * This is used by runJobs.php and not jobs run via $wgJobRunRate.
* These settings should be global to all wikis.
*/
$wgJobBackoffThrottling = array();
$this->addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true );
$this->addOption( 'type', 'Type of job to run', false, true );
$this->addOption( 'procs', 'Number of processes to use', false, true );
+ $this->addOption( 'nothrottle', 'Ignore job throttling configuration', false, false );
}
public function memoryLimit() {
$type = $this->getOption( 'type', false );
$maxJobs = $this->getOption( 'maxjobs', false );
$maxTime = $this->getOption( 'maxtime', false );
+ $noThrottle = $this->hasOption( 'nothrottle' );
$startTime = time();
$group = JobQueueGroup::singleton();
$flags = JobQueueGroup::USE_CACHE;
$lastTime = time(); // time since last slave check
do {
+ $backoffs = array_filter( $backoffs, $backoffExpireFunc );
+ $blacklist = $noThrottle ? array() : array_keys( $backoffs );
if ( $type === false ) {
- $backoffs = array_filter( $backoffs, $backoffExpireFunc );
- $blacklist = array_keys( $backoffs );
$job = $group->pop( JobQueueGroup::TYPE_DEFAULT, $flags, $blacklist );
+ } elseif ( in_array( $type, $blacklist ) ) {
+ $job = false; // requested queue in backoff state
} else {
$job = $group->pop( $type ); // job from a single queue
}