Skip to content

Commit

Permalink
Time need to be set to null not false on empty
Browse files Browse the repository at this point in the history
  • Loading branch information
adambinnersley committed Jul 7, 2021
1 parent 4b89e88 commit e5192e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Caching/RedisCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function addServer($host, $port, $persistent = false)
public function save($key, $value, $time = 0)
{
if(!is_object($value) && !empty($value)){
return $this->cache->set($key, json_encode($value), (is_int($time) && $time > 0 ? $time : false));
return $this->cache->set($key, json_encode($value), (is_int($time) && $time > 0 ? $time : null));
}
return false;
}
Expand All @@ -85,7 +85,7 @@ public function save($key, $value, $time = 0)
*/
public function replace($key, $value, $time = 0)
{
return $this->save($key, json_encode($value), (is_int($time) && $time > 0 ? $time : false));
return $this->save($key, json_encode($value), $time);
}

/**
Expand Down

0 comments on commit e5192e2

Please sign in to comment.