diff options
Diffstat (limited to 'system/libraries/Session/drivers/Session_redis_driver.php')
-rw-r--r-- | system/libraries/Session/drivers/Session_redis_driver.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 8fc0a45da..3437898de 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -365,16 +365,10 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle continue; } - if ($ttl === -2) - { - $set_result = $this->_redis->set($lock_key, time(), array('nx', 'ex' => 300)); - } - else - { - $set_result = $this->_redis->setex($lock_key, 300, time()); - } - - if ( ! $set_result) + $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); return FALSE; |