You are here

public static function BatchProcessor::finishCommit in Automatic Updates 8.2

Finishes the commit batch job.

Parameters

bool $success: Indicate that the batch API tasks were all completed successfully.

array $results: An array of all the results.

array $operations: A list of the operations that had not been completed by the batch API.

File

src/BatchProcessor.php, line 156

Class

BatchProcessor
A batch processor for updates.

Namespace

Drupal\automatic_updates

Code

public static function finishCommit(bool $success, array $results, array $operations) : ?RedirectResponse {
  if ($success) {
    \Drupal::messenger()
      ->addMessage('Update complete!');

    // @todo redirect to update.php?
    return new RedirectResponse(Url::fromRoute('update.status', [], [
      'absolute' => TRUE,
    ])
      ->toString());
  }
  static::handleBatchError($results);
  return NULL;
}