* This inserts the jobs into the queue specified by $wgJobTypeConf
* and updates the aggregate job queue information cache as needed.
*
- * @param Job|array $jobs A single Job or a list of Jobs
+ * @param Job|Job[] $jobs A single Job or a list of Jobs
* @throws MWException
- * @return bool
- * @todo Return value here is not useful
+ * @return void
*/
public function push( $jobs ) {
$jobs = is_array( $jobs ) ? $jobs : array( $jobs );
if ( !count( $jobs ) ) {
- return true;
+ return;
}
$jobsByType = array(); // (job type => list of jobs)
$this->cache->clear( 'queues-ready' );
}
}
-
- return true;
}
/**
public function waitForBackups() {
global $wgJobTypeConf;
- wfProfileIn( __METHOD__ );
// Try to avoid doing this more than once per queue storage medium
foreach ( $wgJobTypeConf as $type => $conf ) {
$this->get( $type )->waitForBackups();
}
- wfProfileOut( __METHOD__ );
}
/**
/**
* Check if there are any queues with jobs (this is cached)
*
- * @param integer $type JobQueueGroup::TYPE_* constant
+ * @param int $type JobQueueGroup::TYPE_* constant
* @return bool
* @since 1.23
*/
}
}
+ if ( $count === 0 ) {
+ return $count; // nothing to update
+ }
+
$wgMemc->merge( $key, function ( $cache, $key, $lastRuns ) use ( $tasksRun ) {
if ( is_array( $lastRuns ) ) {
foreach ( $tasksRun as $type => $tasks ) {
}
/**
- * @param $name string
+ * @param string $name
* @return mixed
*/
private function getCachedConfigVar( $name ) {