Skip to content

Commit

Permalink
Merge pull request #103 from sergiuPHP/master
Browse files Browse the repository at this point in the history
add TTL to PSR16 storage implementation
  • Loading branch information
Kevinrob authored Jan 10, 2018
2 parents 2a9684e + 9954982 commit 6905aaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Storage/Psr16CacheStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public function fetch($key)
*/
public function save($key, CacheEntry $data)
{
$this->cache->set($key, $data);
$ttl = $data->getTTL();
if ($ttl === 0) {
return $this->cache->set($key, $data);
}
return $this->cache->set($key, $data, $data->getTTL());
}

/**
Expand Down

0 comments on commit 6905aaf

Please # to comment.