You are here

public function Redis_Cache::refreshMaxTtl in Redis 7.3

Find from Drupal variables the maximum cache lifetime.

1 call to Redis_Cache::refreshMaxTtl()
Redis_Cache::__construct in lib/Redis/Cache.php

File

lib/Redis/Cache.php, line 235

Class

Redis_Cache
Because those objects will be spawned during boostrap all its configuration must be set in the settings.php file.

Code

public function refreshMaxTtl() {

  // And now cache lifetime. Be aware we exclude negative values
  // considering those are Drupal misconfiguration.
  $maxTtl = variable_get('cache_lifetime', 0);
  if (0 < $maxTtl) {
    if ($maxTtl < $this->permTtl) {
      $this->maxTtl = $maxTtl;
    }
    else {
      $this->maxTtl = $this->permTtl;
    }
  }
  else {
    if ($this->permTtl) {
      $this->maxTtl = $this->permTtl;
    }
  }
}