88 $class = get_class(
$job );
90 $params =
$job->getParams();
92 if ( isset( $params[
'pages'] ) || empty( $params[
'recursive'] ) ) {
95 wfWarn( __METHOD__ .
" called on {$job->getType()} leaf job (explosive recursion)." );
96 } elseif ( isset( $params[
'range'] ) ) {
98 $ranges = $params[
'range'][
'subranges'];
99 $realBSize = $params[
'range'][
'batchSize'];
102 $ranges =
$title->getBacklinkCache()->partition( $params[
'table'], $bSize );
106 $extraParams = $opts[
'params'] ?? [];
111 list( $start, $end ) =
$ranges[0];
112 $iter =
$title->getBacklinkCache()->getLinks( $params[
'table'], $start, $end );
113 $titles = iterator_to_array( $iter );
115 foreach ( array_chunk( $titles, $cSize ) as $titleBatch ) {
117 foreach ( $titleBatch as $tl ) {
118 $pages[$tl->getArticleID()] = [ $tl->getNamespace(), $tl->getDBkey() ];
120 $jobs[] =
new $class(
122 [
'pages' => $pages ] + $extraParams
128 $jobs[] =
new $class(
132 'table' => $params[
'table'],
136 'batchSize' => $realBSize,
137 'subranges' => array_slice(
$ranges, 1 )
140 'division' => isset( $params[
'division'] )
141 ? ( $params[
'division'] + 1 )