*/
public function push( $jobs ) {
$jobs = is_array( $jobs ) ? $jobs : array( $jobs );
+ if ( !count( $jobs ) ) {
+ return true;
+ }
$jobsByType = array(); // (job type => list of jobs)
foreach ( $jobs as $job ) {
return $this->cache->get( 'isDeprioritized', $type );
}
if ( $type === 'refreshLinks2' ) {
- // Don't keep converting refreshLinks2 => refreshLinks jobs if the
+ // Don't keep converting refreshLinksPartition => refreshLinks jobs if the
// later jobs have not been done yet. This helps throttle queue spam.
- $deprioritized = !$this->get( 'refreshLinks' )->isEmpty();
+ // @TODO: this is mostly a WMF-specific hack and should be removed when
+ // refreshLinks2 jobs are drained.
+ $deprioritized = !$this->get( 'refreshLinks' )->getSize() > 10000;
$this->cache->set( 'isDeprioritized', $type, $deprioritized );
return $deprioritized;