Skip to content

Commit

Permalink
Merge pull request #7624 from rchavik/2.8-redis-cache-fix
Browse files Browse the repository at this point in the history
Workaround for Cache::write() call from DboSource::__destruct()
  • Loading branch information
markstory committed Oct 31, 2015
2 parents 90c9ead + c1b6f89 commit aa66293
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Cake/Cache/Engine/RedisEngine.php
Expand Up @@ -113,6 +113,11 @@ public function write($key, $value, $duration) {
if (!is_int($value)) {
$value = serialize($value);
}

if (!$this->_Redis->isConnected()) {
$this->_connect();
}

if ($duration === 0) {
return $this->_Redis->set($key, $value);
}
Expand Down

0 comments on commit aa66293

Please sign in to comment.