cacheTtl fix

This commit is contained in:
Alexander Pankratov 2020-10-08 00:45:10 +03:00
parent 787f06a314
commit d814943168
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ trait ArrayCacheTrait
if (!isset($this->ttlValues[$key])) { if (!isset($this->ttlValues[$key])) {
return $default; return $default;
} }
$this->ttlValues[$key] = \strtotime($this->ttl); $this->ttlValues[$key] = time() + $this->ttl;
return $this->cache[$key]; return $this->cache[$key];
} }
@ -51,7 +51,7 @@ trait ArrayCacheTrait
protected function setCache(string $key, $value): void protected function setCache(string $key, $value): void
{ {
$this->cache[$key] = $value; $this->cache[$key] = $value;
$this->ttlValues[$key] = \strtotime($this->ttl); $this->ttlValues[$key] = time() + $this->ttl;
} }
/** /**