feat : site
This commit is contained in:
@@ -318,19 +318,15 @@ class RedisCache
|
|||||||
* 设置多个key-value 的 hash值
|
* 设置多个key-value 的 hash值
|
||||||
* @param $key
|
* @param $key
|
||||||
* @param $hashKeys
|
* @param $hashKeys
|
||||||
* @param null $expire
|
|
||||||
* @param string $poolName
|
* @param string $poolName
|
||||||
* @return bool|Redis
|
* @return bool|Redis
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @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);
|
$result = $this->getRedis($poolName)->hMset($key, $hashKeys);
|
||||||
if ($expire) {
|
|
||||||
$this->getRedis($poolName)->expire($key, $expire);
|
|
||||||
}
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,19 +349,15 @@ class RedisCache
|
|||||||
* @param $key
|
* @param $key
|
||||||
* @param $hashKey
|
* @param $hashKey
|
||||||
* @param $hashValue
|
* @param $hashValue
|
||||||
* @param int $expire
|
|
||||||
* @param string $poolName
|
* @param string $poolName
|
||||||
* @return bool|int|Redis
|
* @return bool|int|Redis
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @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);
|
$result = $this->getRedis($poolName)->hSet($key, $hashKey, $hashValue);
|
||||||
if ($expire) {
|
|
||||||
$this->getRedis($poolName)->expire($key, $expire);
|
|
||||||
}
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user