public function BatchStorage::cleanup

Cleans up failed or old batches.

Overrides BatchStorageInterface::cleanup

File

drupal/core/lib/Drupal/Core/Utility/BatchStorage.php, line 59
Contains \Drupal\Core\Utility\BatchStorage.

Class

BatchStorage

Namespace

Drupal\Core\Utility

Code

public function cleanup() {

  // Cleanup the batch table and the queue for failed batches.
  $this->connection
    ->delete('batch')
    ->condition('timestamp', REQUEST_TIME - 864000, '<')
    ->execute();
}