diff options
author | Ivan Tcholakov <ivantcholakov@gmail.com> | 2014-08-18 11:04:27 +0200 |
---|---|---|
committer | Ivan Tcholakov <ivantcholakov@gmail.com> | 2014-08-18 11:04:27 +0200 |
commit | d514d5c436e599942f9cb00475f0543e705c9a0f (patch) | |
tree | d6c0c1b45de09aaa5c6a7d20edb61fb6debeca5e /system/libraries/Cache/drivers | |
parent | bc417613f3ea8910a48fc0788a1f9c6d05577aa5 (diff) |
Cache_redis, delete() method: Try to remove a key from Redis auxilary set only when the corresponding value is really deleted.
Diffstat (limited to 'system/libraries/Cache/drivers')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_redis.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index 20378785a..b5387c064 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -134,10 +134,13 @@ class CI_Cache_redis extends CI_Driver */ public function delete($key) { - // This is for not leaving garbage keys within the Redis auxilary set. - $this->_redis->sRemove('_ci_redis_serialized', $key); + if ($result = ($this->_redis->delete($key) === 1)) + { + // This is for not leaving garbage keys within the Redis auxilary set. + $this->_redis->sRemove('_ci_redis_serialized', $key); + } - return ($this->_redis->delete($key) === 1); + return $result; } // ------------------------------------------------------------------------ |