diff options
author | Andrey Andreev <narf@devilix.net> | 2019-05-11 00:04:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-11 00:04:41 +0200 |
commit | 37f2c3d53ebcdaf68a6e257136c8f17545b3bebb (patch) | |
tree | c1ba35594f54a1e0730cd95ad384ff5f32c48cae /system | |
parent | 80c20dcfded0df95457acf5cd9b437d2a268bc85 (diff) | |
parent | c7c8673517cf4bde03bf68badd4cbf6770ea66d5 (diff) |
[ci skip] Merge pull request #5752 from exussum12/alternativeRedisFix
Alterntive redis fix
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_redis.php | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index 37596189a..8a7df7abd 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -135,10 +135,6 @@ class CI_Cache_redis extends CI_Driver { log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')'); } - - // Initialize the index of serialized values. - $serialized = $this->_redis->sMembers('_ci_redis_serialized'); - empty($serialized) OR $this->_serialized = array_flip($serialized); } // ------------------------------------------------------------------------ @@ -153,7 +149,7 @@ class CI_Cache_redis extends CI_Driver { $value = $this->_redis->get($key); - if ($value !== FALSE && isset($this->_serialized[$key])) + if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key)) { return unserialize($value); } @@ -184,9 +180,8 @@ class CI_Cache_redis extends CI_Driver isset($this->_serialized[$id]) OR $this->_serialized[$id] = TRUE; $data = serialize($data); } - elseif (isset($this->_serialized[$id])) + else { - $this->_serialized[$id] = NULL; $this->_redis->sRemove('_ci_redis_serialized', $id); } @@ -208,11 +203,7 @@ class CI_Cache_redis extends CI_Driver return FALSE; } - if (isset($this->_serialized[$key])) - { - $this->_serialized[$key] = NULL; - $this->_redis->sRemove('_ci_redis_serialized', $key); - } + $this->_redis->sRemove('_ci_redis_serialized', $key); return TRUE; } |