mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-16 03:58:39 +00:00
handle invalid keys
This commit is contained in:
parent
6adebce0f8
commit
4b2d8bc2ed
|
|
@ -106,6 +106,10 @@ class MemCached extends ConnectionAbstract
|
|||
|
||||
$result = $this->con->get($key);
|
||||
|
||||
if ($this->con->getResultCode() !== \Memcached::RES_SUCCESS) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class RedisCache extends ConnectionAbstract
|
|||
*/
|
||||
public function get($key, int $expire = -1)
|
||||
{
|
||||
if ($this->status !== CacheStatus::OK) {
|
||||
if ($this->status !== CacheStatus::OK || !$this->con->exists($key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user