Merge "Fix \n handling for HTMLUsersMultiselectField"
[lhc/web/wiklou.git] / includes / jobqueue / utils / BacklinkJobUtils.php
index 7fb020b..76f8d6d 100644 (file)
@@ -19,7 +19,6 @@
  *
  * @file
  * @ingroup JobQueue
- * @author Aaron Schulz
  */
 
 /**
@@ -33,7 +32,7 @@
  * For example, if templates A and B are edited (at the same time) the queue will have:
  *     (A base, B base)
  * When these jobs run, the queue will have per-title and remnant partition jobs:
- *        (titleX,titleY,titleZ,...,A remnant,titleM,titleN,titleO,...,B remnant)
+ *     (titleX,titleY,titleZ,...,A remnant,titleM,titleN,titleO,...,B remnant)
  *
  * This works best when the queue is FIFO, for several reasons:
  *   - a) Since the remnant jobs are enqueued after the leaf jobs, the slower leaf jobs have to
@@ -116,7 +115,7 @@ class BacklinkJobUtils {
                        foreach ( array_chunk( $titles, $cSize ) as $titleBatch ) {
                                $pages = [];
                                foreach ( $titleBatch as $tl ) {
-                                       $pages[$tl->getArticleId()] = [ $tl->getNamespace(), $tl->getDBKey() ];
+                                       $pages[$tl->getArticleID()] = [ $tl->getNamespace(), $tl->getDBkey() ];
                                }
                                $jobs[] = new $class(
                                        $title, // maintain parent job title
@@ -133,10 +132,14 @@ class BacklinkJobUtils {
                                        'table'         => $params['table'],
                                        'range'         => [
                                                'start'     => $ranges[1][0],
-                                               'end'       => $ranges[count( $ranges ) - 1][1],
+                                               'end'       => $ranges[count( $ranges ) - 1][1],
                                                'batchSize' => $realBSize,
                                                'subranges' => array_slice( $ranges, 1 )
                                        ],
+                                       // Track how many times the base job divided for debugging
+                                       'division'      => isset( $params['division'] )
+                                               ? ( $params['division'] + 1 )
+                                               : 1
                                ] + $extraParams
                        );
                }