Skip to content

Commit

Permalink
Merge pull request #612 from tynanbe/object_cache_redis_exception
Browse files Browse the repository at this point in the history
Return false when Redis fails to set a value
  • Loading branch information
hi-hai authored Jan 18, 2024
2 parents cf9a46a + bf1d4f5 commit 43a05fb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/object-cache.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ public function set($key, $data, $expire)
try {
$res = $this->_conn->setEx($key, $ttl, $data);
} catch (\RedisException $ex) {
$res = false;
$msg = sprintf(__('Redis encountered a fatal error: %s (code: %d)', 'litespeed-cache'), $ex->getMessage(), $ex->getCode());
Debug2::debug('[Object] ' . $msg);
Admin_Display::error($msg);
Expand Down

0 comments on commit 43a05fb

Please sign in to comment.