Fixing redis cachekey
This commit is contained in:
parent
3e53dab817
commit
d7426e697d
1 changed files with 3 additions and 3 deletions
|
@ -144,14 +144,14 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
||||||
|
|
||||||
$this->redis->watch($cachekey);
|
$this->redis->watch($cachekey);
|
||||||
// If the old value isn't what we expected, somebody else changed the key meanwhile
|
// If the old value isn't what we expected, somebody else changed the key meanwhile
|
||||||
if ($this->get($cachekey) === $oldValue) {
|
if ($this->get($key) === $oldValue) {
|
||||||
if ($ttl > 0) {
|
if ($ttl > 0) {
|
||||||
$result = $this->redis->multi()
|
$result = $this->redis->multi()
|
||||||
->setex($cachekey, $ttl, $newCached)
|
->setex($cachekey, $ttl, $newCached)
|
||||||
->exec();
|
->exec();
|
||||||
} else {
|
} else {
|
||||||
$result = $this->redis->multi()
|
$result = $this->redis->multi()
|
||||||
->set($cachekey, $newValue)
|
->set($cachekey, $newCached)
|
||||||
->exec();
|
->exec();
|
||||||
}
|
}
|
||||||
return $result !== false;
|
return $result !== false;
|
||||||
|
@ -169,7 +169,7 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
||||||
|
|
||||||
$this->redis->watch($cachekey);
|
$this->redis->watch($cachekey);
|
||||||
// If the old value isn't what we expected, somebody else changed the key meanwhile
|
// If the old value isn't what we expected, somebody else changed the key meanwhile
|
||||||
if ($this->get($cachekey) === $value) {
|
if ($this->get($key) === $value) {
|
||||||
$result = $this->redis->multi()
|
$result = $this->redis->multi()
|
||||||
->del($cachekey)
|
->del($cachekey)
|
||||||
->exec();
|
->exec();
|
||||||
|
|
Loading…
Reference in a new issue