function ctools_object_cache_clean in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 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 158 - 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)) {
$age = 86400 * 7;
// 7 days
}
db_query("DELETE FROM {ctools_object_cache} WHERE updated < %d", time() - $age);
}