Skip to content

Commit

Permalink
Add boolean return value for addValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
phpnode committed Mar 19, 2012
1 parent a8c5afc commit fd34fd7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ARedisCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ protected function addValue($key,$value,$expire) {
else
$expire=0;

$this->getConnection()->getClient()->setnx($key,$value);
if (!$this->getConnection()->getClient()->setnx($key,$value)) {
return false;
}
if ($expire) {
$this->getConnection()->getClient()->expire($key,$expire);
}
return true;
}

/**
Expand Down

0 comments on commit fd34fd7

Please sign in to comment.