You are here

protected function DrupalFileCache::delete_flushed in File Cache 7

Delete flushed cache entries.

1 call to DrupalFileCache::delete_flushed()
DrupalFileCache::get in ./filecache.inc
Return data from the persistent cache. Data may be stored as either plain text or as serialized data. cache_get will automatically return unserialized objects and arrays.

File

./filecache.inc, line 540
DrupalFileCache class that implements DrupalCacheInterface.

Class

DrupalFileCache

Code

protected function delete_flushed() {
  static $recursion = FALSE;

  // XXX how cache.inc survives this?
  if ($recursion) {
    return;
  }
  $recursion = TRUE;

  // Garbage collection necessary when enforcing a minimum cache lifetime.
  $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
  if ($cache_flush && $cache_flush + variable_get('cache_lifetime', 0) <= REQUEST_TIME) {

    // Reset the variable immediately to prevent a meltdown in heavy load situations.
    variable_set('cache_flush_' . $this->bin, 0);

    // Time to flush old cache data
    $this
      ->delete_expired($cache_flush);
  }

  // if $cache_flush
  $recursion = FALSE;
}