Skip to content

Commit

Permalink
Shorten TTL handling for redis
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-scythe authored and ikkez committed Nov 14, 2016
1 parent aeca9d6 commit 74bbb1e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions base.php
Original file line number Diff line number Diff line change
Expand Up @@ -2417,11 +2417,7 @@ function set($key,$val,$ttl=0) {
case 'apcu':
return apc_store($ndx,$data,$ttl);
case 'redis':
if($ttl > 0) {
return $this->ref->set($ndx,$data,array('ex'=>$ttl));
} else {
return $this->ref->set($ndx,$data);
}
return $this->ref->set($ndx,$data, $ttl ? ['ex'=>$ttl] : []);
case 'memcache':
return memcache_set($this->ref,$ndx,$data,0,$ttl);
case 'wincache':
Expand Down

0 comments on commit 74bbb1e

Please sign in to comment.