$this->redis = new Redis();
$this->redis->connect($host, $port);
$this->redis->auth($auth);
回复内容:
现在是这么连的,有时候redis不稳定,很难连接上,如何设置超时时间?
$this->redis = new Redis();
$this->redis->connect($host, $port);
$this->redis->auth($auth);
$this->redis->connect($host, $port,3); 3秒连接超时