]> git.mxchange.org Git - friendica.git/commitdiff
Fixing redis cachekey
authorPhilipp Holzer <admin@philipp.info>
Mon, 4 Mar 2019 20:09:20 +0000 (21:09 +0100)
committerPhilipp Holzer <admin@philipp.info>
Mon, 4 Mar 2019 20:09:20 +0000 (21:09 +0100)
src/Core/Cache/RedisCacheDriver.php

index 55dc09156a980fba80d80326bdcfc306bd9ad8a2..6559cf6a7279be9fcbe031910209f243afa2395a 100644 (file)
@@ -144,14 +144,14 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
 
                $this->redis->watch($cachekey);
                // 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) {
                                $result = $this->redis->multi()
                                        ->setex($cachekey, $ttl, $newCached)
                                        ->exec();
                        } else {
                                $result = $this->redis->multi()
-                                       ->set($cachekey, $newValue)
+                                       ->set($cachekey, $newCached)
                                        ->exec();
                        }
                        return $result !== false;
@@ -169,7 +169,7 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
 
                $this->redis->watch($cachekey);
                // 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()
                                ->del($cachekey)
                                ->exec();