This commit is contained in:
2021-03-29 15:25:39 +08:00
parent 345ead8ba4
commit 7aa303ea16
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ class Redis extends Component
* @return bool * @return bool
* @throws Exception * @throws Exception
*/ */
public function lock($key, $timeout = 5) public function lock($key, $timeout = 5): bool
{ {
$script = <<<SCRIPT $script = <<<SCRIPT
local _nx = redis.call('setnx',KEYS[1], ARGV[1]) local _nx = redis.call('setnx',KEYS[1], ARGV[1])
+1 -1
View File
@@ -53,7 +53,7 @@ class Redis extends Pool
* @param mixed $config * @param mixed $config
* @return SRedis * @return SRedis
* @throws RedisConnectException * @throws RedisConnectException
* @throws ComponentException * @throws Exception
*/ */
public function createClient(string $name, mixed $config): SRedis public function createClient(string $name, mixed $config): SRedis
{ {