handle invalid keys

This commit is contained in:
Dennis Eichhorn 2019-12-07 21:28:01 +01:00
parent 6adebce0f8
commit 4b2d8bc2ed
2 changed files with 5 additions and 1 deletions

View File

@ -106,6 +106,10 @@ class MemCached extends ConnectionAbstract
$result = $this->con->get($key); $result = $this->con->get($key);
if ($this->con->getResultCode() !== \Memcached::RES_SUCCESS) {
return null;
}
return $result; return $result;
} }

View File

@ -123,7 +123,7 @@ class RedisCache extends ConnectionAbstract
*/ */
public function get($key, int $expire = -1) public function get($key, int $expire = -1)
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK || !$this->con->exists($key)) {
return null; return null;
} }