Cache::remember -1 = infinite

Patching from 1.x
This commit is contained in:
slawkens
2026-01-30 22:52:55 +01:00
parent 7378905ae8
commit 92254e2671

View File

@@ -123,8 +123,13 @@ class Cache
return unserialize($value); return unserialize($value);
} }
// -1 for infinite cache
if ($ttl == -1) {
$ttl = 10 * 365 * 24 * 60 * 60; // 10 years should be enough
}
$value = $callback(); $value = $callback();
$cache->set($key, serialize($value),$ttl); $cache->set($key, serialize($value), $ttl);
return $value; return $value;
} }
} }