From 01015d910f4b3361153c00173ba2998d0b312ba7 Mon Sep 17 00:00:00 2001 From: Mathew White Date: Sun, 22 Mar 2015 12:46:49 +0000 Subject: Fixed redis cache save logic It was trying to use sAdd as a check if the key was created, but that will return false if it is already present in the set. --- system/libraries/Cache/drivers/Cache_redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Cache') diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index 5236556d9..a35fbf6d2 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -111,7 +111,7 @@ class CI_Cache_redis extends CI_Driver { if (is_array($data) OR is_object($data)) { - if ( ! $this->_redis->sAdd('_ci_redis_serialized', $id)) + if ( ! $this->_redis->sIsMember('_ci_redis_serialized', $id) && ! $this->_redis->sAdd('_ci_redis_serialized', $id)) { return FALSE; } -- cgit v1.2.3-24-g4f1b