diff options
author | tianhe1986 <w1s2j3229@163.com> | 2017-07-06 03:25:01 +0200 |
---|---|---|
committer | tianhe1986 <w1s2j3229@163.com> | 2017-07-06 03:25:01 +0200 |
commit | 24e91311bd86b9eddb9ffb2d4b6ab78bf19796c2 (patch) | |
tree | a899e7ae6d194e017f7839787df1a2972afdd0a1 /system/libraries/Session/drivers | |
parent | 3eecd968bd68cf3c70baa81be332b2007a14e564 (diff) |
Format fixing.
Signed-off-by: tianhe1986 <w1s2j3229@163.com>
Diffstat (limited to 'system/libraries/Session/drivers')
-rw-r--r-- | system/libraries/Session/drivers/Session_memcached_driver.php | 7 | ||||
-rw-r--r-- | system/libraries/Session/drivers/Session_redis_driver.php | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php index 8c01a8783..5e90539d7 100644 --- a/system/libraries/Session/drivers/Session_memcached_driver.php +++ b/system/libraries/Session/drivers/Session_memcached_driver.php @@ -326,11 +326,8 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa continue; } - $result = ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND) - ? $this->_memcached->add($lock_key, time(), 300) - : $this->_memcached->set($lock_key, time(), 300); - - if ( ! $result) + $method = ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND) ? 'add' : 'set'; + if ( ! $this->_memcached->$method($lock_key, time(), 300)) { log_message('error', 'Session: Error while trying to obtain lock for '.$this->_key_prefix.$session_id); return FALSE; diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 3437898de..76bddffd3 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -368,6 +368,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $result = ($ttl === -2) ? $this->_redis->set($lock_key, time(), array('nx', 'ex' => 300)) : $this->_redis->setex($lock_key, 300, time()); + if ( ! $result) { log_message('error', 'Session: Error while trying to obtain lock for '.$this->_key_prefix.$session_id); |