dashboard/dashboard/spa/alerts-section.js
function loadMore(batches, alertGroups, nextRequests, triagedRequests,
    triagedMaxStartRevision, started) {
  const minStartRevision = tr.b.math.Statistics.min(
      alertGroups, group => tr.b.math.Statistics.min(
          group.alerts, a => a.startRevision));

  if (!triagedMaxStartRevision ||
      (minStartRevision < triagedMaxStartRevision)) {
    for (const request of triagedRequests) {
      request.min_start_revision = minStartRevision;
      if (triagedMaxStartRevision) {
        request.max_start_revision = triagedMaxStartRevision;
      }
      batches.add(wrapRequest(request));
    }
  }

  for (const next of nextRequests) {
    // Always chase down cursors for triaged alerts.
    // Limit the number of alertGroups displayed to prevent OOM.
    if (next.bug_id === '*' ||
        (alertGroups.length < ENOUGH_GROUPS &&
        ((performance.now() - started) < ENOUGH_LOADING_MS))) {
      batches.add(wrapRequest(next));
    }
  }

  return minStartRevision;
}
function loadMore(batches, alertGroups, nextRequests, triagedRequests,
    triagedMaxStartRevision, started) {
  const minStartRevision = tr.b.math.Statistics.min(
      alertGroups, group => tr.b.math.Statistics.min(
          group.alerts, a => a.startRevision));

  if (!triagedMaxStartRevision ||
      (minStartRevision < triagedMaxStartRevision)) {
    for (const request of triagedRequests) {
      request.min_start_revision = minStartRevision;
      if (triagedMaxStartRevision) {
        request.max_start_revision = triagedMaxStartRevision;
      }
      batches.add(wrapRequest(request));
    }
  }

  for (const next of nextRequests) {
    // Always chase down cursors for triaged alerts.
    // Limit the number of alertGroups displayed to prevent OOM.
    if (next.bug_id === '*' ||
        (alertGroups.length < ENOUGH_GROUPS &&
        ((performance.now() - started) < ENOUGH_LOADING_MS))) {
      batches.add(wrapRequest(next));
    }
  }

  return minStartRevision;
}
function loadMore ( batches , alertGroups , nextRequests , triagedRequests , triagedMaxStartRevision , started ) { const minStartRevision = tr . b . math . Statistics . min ( alertGroups , group => tr . b . math . Statistics . min ( group . alerts , a => a . startRevision ) ) ; if ( ! triagedMaxStartRevision || ( minStartRevision < triagedMaxStartRevision ) ) { for ( const request of triagedRequests ) { request . min_start_revision = minStartRevision ; if ( triagedMaxStartRevision ) { request . max_start_revision = triagedMaxStartRevision ; } batches . add ( wrapRequest ( request ) ) ; } } for ( const next of nextRequests ) { // Always chase down cursors for triaged alerts. // Limit the number of alertGroups displayed to prevent OOM. if ( next . bug_id === '*' || ( alertGroups . length < ENOUGH_GROUPS && ( ( performance . now ( ) - started ) < ENOUGH_LOADING_MS ) ) ) { batches . add ( wrapRequest ( next ) ) ; } } return minStartRevision ; }
This function may add requests to `batches`. See handleBatch for `nextRequests` and `triagedRequests`.
This function may add requests to batches . See handleBatch for nextRequests and triagedRequests .