Skip to content

Commit

Permalink
Expose failed lock attempts. Get normal lifetime from config handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour committed Feb 3, 2016
1 parent 1308ddc commit 95330b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Cm/RedisSession/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,16 @@ public function gc($maxLifeTime)
return true;
}

/**
* Get the number of failed lock attempts
*
* @return int
*/
public function getFailedLockAttempts()
{
return $this->failedLockAttempts;
}

/**
* Get lock lifetime
*
Expand Down Expand Up @@ -664,9 +674,10 @@ private function getLifeTime()

// Neither bot nor first write
if ($lifeTime === null) {
$this->_lifeTime = self::DEFAULT_LIFETIME;
$lifeTime = $this->config->getLifetime();
}

$this->_lifeTime = $lifeTime;
if ($this->_lifeTime < $this->_minLifetime) {
$this->_lifeTime = $this->_minLifetime;
}
Expand Down
7 changes: 7 additions & 0 deletions src/Cm/RedisSession/Handler/ConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ public function getCompressionLibrary();
*/
public function getMaxConcurrency();

/**
* Get the normal session lifetime
*
* @return int
*/
public function getLifetime();

/**
* Get the maximum session lifetime
*
Expand Down

0 comments on commit 95330b7

Please sign in to comment.