[core] default cache TTL to null rather than zero, fixes #997
This commit is contained in:
parent
046f70c3ba
commit
15582c5138
1 changed files with 1 additions and 1 deletions
|
@ -797,7 +797,7 @@ function stringer($s): string
|
||||||
* If a value is in the cache, return it; otherwise, call the callback
|
* If a value is in the cache, return it; otherwise, call the callback
|
||||||
* to generate it and store it in the cache.
|
* 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;
|
global $cache;
|
||||||
$value = $cache->get($key);
|
$value = $cache->get($key);
|
||||||
|
|
Reference in a new issue