diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-04-21 17:15:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-04-21 17:15:51 +0000 |
commit | 920babfe6ea1c929d7df16631e4de52f0646e518 (patch) | |
tree | 3a66802b33124cbf523fe1f1da7a110870192713 /includes | |
parent | 04b3e8d08a48e4085f5be34464cb8a98872f5a19 (diff) | |
download | brdo-920babfe6ea1c929d7df16631e4de52f0646e518.tar.gz brdo-920babfe6ea1c929d7df16631e4de52f0646e518.tar.bz2 |
- Patch #227228 by catch et al: fix a problem with minumum cache lifetime being global.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/cache.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/cache.inc b/includes/cache.inc index 21f79ba6b..6d9c94e61 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -18,10 +18,10 @@ function cache_get($cid, $table = 'cache') { global $user; // Garbage collection necessary when enforcing a minimum cache lifetime - $cache_flush = variable_get('cache_flush', 0); + $cache_flush = variable_get('cache_flush_' . $table, 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', 0); + variable_set('cache_flush_' . $table, 0); // Time to flush old cache data db_delete($table) ->condition('expire', CACHE_PERMANENT, '<>') @@ -165,10 +165,10 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) { // cached data that was cached before the timestamp. $user->cache = REQUEST_TIME; - $cache_flush = variable_get('cache_flush', 0); + $cache_flush = variable_get('cache_flush_' . $table, 0); if ($cache_flush == 0) { // This is the first request to clear the cache, start a timer. - variable_set('cache_flush', REQUEST_TIME); + variable_set('cache_flush_' . $table, REQUEST_TIME); } elseif (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime', 0))) { // Clear the cache for everyone, cache_flush_delay seconds have @@ -177,7 +177,7 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) { ->condition('expire', CACHE_PERMANENT, '<>') ->condition('expire', REQUEST_TIME, '<') ->execute(); - variable_set('cache_flush', 0); + variable_set('cache_flush_' . $table, 0); } } else { |