From 1c3a52350a906a3135f245db79dffd98b6167c03 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Fri, 14 Mar 2025 15:15:01 +0800 Subject: [PATCH] feat : site --- app/Cache/Redis/RedisCache.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/Cache/Redis/RedisCache.php b/app/Cache/Redis/RedisCache.php index bc0db7b..8f87070 100644 --- a/app/Cache/Redis/RedisCache.php +++ b/app/Cache/Redis/RedisCache.php @@ -318,19 +318,15 @@ class RedisCache * 设置多个key-value 的 hash值 * @param $key * @param $hashKeys - * @param null $expire * @param string $poolName * @return bool|Redis * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface - * @throws RedisException */ - public function hMset($key, $hashKeys, $expire = null, string $poolName = RedisCode::DEFAULT_DB) + public function hMset($key, $hashKeys, string $poolName = RedisCode::DEFAULT_DB) { $result = $this->getRedis($poolName)->hMset($key, $hashKeys); - if ($expire) { - $this->getRedis($poolName)->expire($key, $expire); - } + return $result; } @@ -353,19 +349,15 @@ class RedisCache * @param $key * @param $hashKey * @param $hashValue - * @param int $expire * @param string $poolName * @return bool|int|Redis * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface - * @throws RedisException */ - public function hSet($key, $hashKey, $hashValue, int $expire = 0, string $poolName = RedisCode::DEFAULT_DB) + public function hSet($key, $hashKey, $hashValue, string $poolName = RedisCode::DEFAULT_DB) { $result = $this->getRedis($poolName)->hSet($key, $hashKey, $hashValue); - if ($expire) { - $this->getRedis($poolName)->expire($key, $expire); - } + return $result; }