Permalink
Browse files

Add boolean return value for addValue()

  • Loading branch information...
1 parent a8c5afc commit fd34fd76e02d37acdcdeb6197a39d2e046ac16d1 @phpnode committed Mar 19, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 ARedisCache.php
View
@@ -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;
}
/**

0 comments on commit fd34fd7

Please sign in to comment.