Shutdown function: Stores the current batch data for the next request.
_batch_page()
drupal_register_shutdown_function()
function _batch_shutdown() { if ($batch = batch_get()) { Drupal::service('batch.storage') ->update($batch); } }