cache fixes

This commit is contained in:
Dennis Eichhorn 2024-05-18 23:47:56 +02:00
parent 4b8475f890
commit 991d7d2b80
2 changed files with 14 additions and 12 deletions

View File

@ -113,7 +113,7 @@ final class RedisCache extends ConnectionAbstract
} }
if ($expire > 0) { if ($expire > 0) {
$this->con->set((string) $key, $expire, $this->build($value)); $this->con->set((string) $key, $this->build($value), $expire);
return; return;
} }
@ -247,7 +247,10 @@ final class RedisCache extends ConnectionAbstract
$values = []; $values = [];
foreach ($keys as $key) { foreach ($keys as $key) {
if (\preg_match('/' . $pattern . '/', $key) === 1) { if (\preg_match('/' . $pattern . '/', $key) !== 1) {
continue;
}
$result = $this->con->get((string) $key); $result = $this->con->get((string) $key);
if (\is_string($result) && ($result[0] ?? null) === self::DELIM) { if (\is_string($result) && ($result[0] ?? null) === self::DELIM) {
$result = \substr($result, 1); $result = \substr($result, 1);
@ -258,7 +261,6 @@ final class RedisCache extends ConnectionAbstract
$values[] = $result; $values[] = $result;
} }
}
return $values; return $values;
} }