Skip to content

Commit

Permalink
Merge pull request #133 from LeaseWeb/master
Browse files Browse the repository at this point in the history
Removed session locking on write, added unlock on destroy
  • Loading branch information
snc committed Apr 18, 2014
2 parents 52549ac + d3d1fce commit 6503cfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions Session/Storage/Handler/RedisSessionHandler.php
Expand Up @@ -157,14 +157,6 @@ public function read($sessionId)
*/
public function write($sessionId, $data)
{
if ($this->locking) {
if (!$this->locked) {
if (!$this->lockSession($sessionId)) {
return false;
}
}
}

if (0 < $this->ttl) {
$this->redis->setex($this->getRedisKey($sessionId), $this->ttl, $data);
} else {
Expand All @@ -178,6 +170,7 @@ public function write($sessionId, $data)
public function destroy($sessionId)
{
$this->redis->del($this->getRedisKey($sessionId));
$this->close();

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Session/Storage/Handler/RedisSessionHandlerTest.php
Expand Up @@ -101,6 +101,6 @@ public function testSessionLocking()
;

$handler = new RedisSessionHandler($this->redis, array(), 'session', true, 1000000);
$handler->write('_symfony', 'some data');
$handler->read('_symfony');
}
}

0 comments on commit 6503cfc

Please sign in to comment.