[core] default cache TTL to null rather than zero, fixes #997

This commit is contained in:
Shish 2024-01-07 18:47:32 +00:00
parent 046f70c3ba
commit 15582c5138

View file

@ -797,7 +797,7 @@ function stringer($s): string
* If a value is in the cache, return it; otherwise, call the callback
* to generate it and store it in the cache.
*/
function cache_get_or_set(string $key, callable $callback, int $ttl = 0)
function cache_get_or_set(string $key, callable $callback, ?int $ttl = null)
{
global $cache;
$value = $cache->get($key);