[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:
David Härdeman 2021-08-26 23:32:23 +02:00
parent c8678953fe
commit 34b8a4395a

View file

@ -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