mirror of
https://github.com/danog/AsyncOrm.git
synced 2024-12-02 09:38:31 +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
|
public function get(string|int $index): mixed
|
||||||
{
|
{
|
||||||
if (isset($this->ttl[$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];
|
return $this->cache[$index];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->inner->offsetGet($index);
|
$result = $this->inner->offsetGet($index);
|
||||||
if (isset($this->ttl[$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];
|
return $this->cache[$index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user