You are here

function ctools_object_cache_clean in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/object-cache.inc \ctools_object_cache_clean()

Remove all objects in the object cache that are older than the specified age.

Parameters

$age: The minimum age of objects to remove, in seconds. For example, 86400 is one day. Defaults to 7 days.

1 call to ctools_object_cache_clean()
ctools_object_cache_cron in includes/object-cache.cron.inc
@file Contains cron hooks for the object cache tool.

File

includes/object-cache.inc, line 203
The non-volatile object cache is used to store an object while it is being edited, so that we don't have to save until we're completely done. The cache should be 'cleaned' on a regular basis, meaning to remove old objects from the…

Code

function ctools_object_cache_clean($age = NULL) {
  if (empty($age)) {

    // 7 days.
    $age = 86400 * 7;
  }
  db_delete('ctools_object_cache')
    ->condition('updated', REQUEST_TIME - $age, '<')
    ->execute();
}