Skip to content

Commit

Permalink
Do not send expire to Redis when value is zero (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bournwog authored and opengeek committed Sep 26, 2023
1 parent dd5b4fa commit a68a0b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/xPDO/Cache/xPDORedisCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public function add($key, $var, $expire= 0, $options= array()) {
}

public function set($key, $var, $expire= 0, $options= array()) {
$set=$this->redis->set($this->getCacheKey($key),$var,$expire);
if ($expire === 0) {
$set = $this->redis->set($this->getCacheKey($key),$var);
} else {
$set = $this->redis->set($this->getCacheKey($key),$var,$expire);
}
return $set;
}

Expand Down

0 comments on commit a68a0b3

Please sign in to comment.