Try to be less clever in redis get method
Gitea - aviat/banker/pipeline/head This commit looks good Details

This commit is contained in:
Timothy Warren 2023-03-16 22:09:17 -04:00
parent a1279b2980
commit 73e646da5a
2 changed files with 2 additions and 5 deletions

View File

@ -28,7 +28,7 @@
"require": { "require": {
"php": ">= 8", "php": ">= 8",
"ext-json": "*", "ext-json": "*",
"predis/predis": "^v1.1.10", "predis/predis": "^v2.1.2",
"psr/log": "^1.1.0 || ^3.0.0", "psr/log": "^1.1.0 || ^3.0.0",
"psr/cache": "^3.0.0", "psr/cache": "^3.0.0",
"psr/simple-cache": "^3.0.0" "psr/simple-cache": "^3.0.0"

View File

@ -79,10 +79,7 @@ class RedisDriver extends AbstractDriver {
public function get(string $key): mixed public function get(string $key): mixed
{ {
$raw = $this->conn->get($key) ?? ''; $raw = $this->conn->get($key) ?? '';
$parsed = @unserialize($raw); return unserialize($raw);
$hasError = is_array(error_get_last());
return ($hasError) ? NULL : $parsed;
} }
/** /**