mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
[redis] Fix call to setex()
\Predis\Client\setex doesn't return a boolean, but the current Redis caching functionality expects it to do so.
This commit is contained in:
parent
c8678953fe
commit
34b8a4395a
1 changed files with 8 additions and 1 deletions
|
|
@ -70,7 +70,14 @@ class Redis implements \MailSo\Cache\DriverInterface
|
|||
|
||||
public function Set(string $sKey, string $sValue) : bool
|
||||
{
|
||||
return $this->oRedis ? $this->oRedis->setex($this->generateCachedKey($sKey), $this->iExpire, $sValue) : false;
|
||||
if (!$this->oRedis)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$sValue = $this->oRedis->setex($this->generateCachedKey($sKey), $this->iExpire, $sValue);
|
||||
|
||||
return $sValue === true || $sValue == 'OK';
|
||||
}
|
||||
|
||||
public function Get(string $sKey) : string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue