You are here

public function MongoBatchBackend::cleanup in MongoDB 8

Cleans up failed or old batches.

Overrides BatchStorageInterface::cleanup

File

src/MongoBatchBackend.php, line 102
Contains \Drupal\mongodb\MongoBatchBackend.

Class

MongoBatchBackend

Namespace

Drupal\mongodb

Code

public function cleanup() {

  // Cleanup the batch table and the queue for failed batches.
  $remove['expire']['$lt'] = REQUEST_TIME - 864000;
  $this
    ->mongoCollection()
    ->remove($remove);
}