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; }