mirror of
https://github.com/danog/AsyncOrm.git
synced 2024-11-30 04:39:45 +01:00
Minor fix
This commit is contained in:
parent
f16daf9c1c
commit
124e1acbda
@ -81,13 +81,17 @@ final class CacheContainer
|
||||
public function get(string|int $index): mixed
|
||||
{
|
||||
if (isset($this->ttl[$index])) {
|
||||
$this->ttl[$index] = \time() + $this->cacheTtl;
|
||||
if ($this->ttl[$index] !== true) {
|
||||
$this->ttl[$index] = \time() + $this->cacheTtl;
|
||||
}
|
||||
return $this->cache[$index];
|
||||
}
|
||||
|
||||
$result = $this->inner->offsetGet($index);
|
||||
if (isset($this->ttl[$index])) {
|
||||
$this->ttl[$index] = \time() + $this->cacheTtl;
|
||||
if ($this->ttl[$index] !== true) {
|
||||
$this->ttl[$index] = \time() + $this->cacheTtl;
|
||||
}
|
||||
return $this->cache[$index];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user