正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -7,14 +7,14 @@ use Swoole\Database\RedisPool; | @@ -7,14 +7,14 @@ use Swoole\Database\RedisPool; | ||
| 7 | class RedisCli | 7 | class RedisCli |
| 8 | { | 8 | { |
| 9 | private $pool; | 9 | private $pool; |
| 10 | - public function __construct($host,$port,$password,$dbIndex, $num = 20) | 10 | + public function __construct($host,$port,$password,$dbIndex, $timeout=0, $num = 20) |
| 11 | { | 11 | { |
| 12 | $this->pool = new RedisPool((new RedisConfig) | 12 | $this->pool = new RedisPool((new RedisConfig) |
| 13 | ->withHost($host) | 13 | ->withHost($host) |
| 14 | ->withPort($port) | 14 | ->withPort($port) |
| 15 | ->withAuth($password) | 15 | ->withAuth($password) |
| 16 | ->withDbIndex($dbIndex) | 16 | ->withDbIndex($dbIndex) |
| 17 | - ->withTimeout(5) | 17 | + ->withTimeout($timeout) |
| 18 | ,$num //默认64个连接池 | 18 | ,$num //默认64个连接池 |
| 19 | ); | 19 | ); |
| 20 | } | 20 | } |
-
请 注册 或 登录 后发表评论