BatchStorage::cleanup

public BatchStorage::cleanup()

Cleans up failed or old batches.

Overrides BatchStorageInterface::cleanup

File

core/lib/Drupal/Core/Batch/BatchStorage.php, line 108

Class

BatchStorage

Namespace

Drupal\Core\Batch

Code

1
2
3
4
5
6
7
8
9
10
11
public function cleanup() {
  try {
    // Cleanup the batch table and the queue for failed batches.
    $this->connection->delete('batch')
      ->condition('timestamp', REQUEST_TIME - 864000, '<')
      ->execute();
  }
  catch (\Exception $e) {
    $this->catchException($e);
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.