Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5bc02b

Browse files
committed
feat:redis:database:修改默认连接timeout=10s
1 parentacc07d5 commitf5bc02b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

‎src/CommandInvoker.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function receive(Connection $connection)
114114
* @param string $command
115115
* @param int $number
116116
* @return array
117-
* @throws \Throwable
117+
* @throws \Swoole\Exception
118118
*/
119119
publicfunctioninvoke(string$command,int$number)
120120
{

‎src/Subscriber.php‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Subscriber
2828
* 超时
2929
* @var float
3030
*/
31-
public$timeout =0.0;
31+
public$timeout =10.0;
3232

3333
/**
3434
* 密码
@@ -55,25 +55,23 @@ class Subscriber
5555
* @param string $password
5656
* @param float $timeout
5757
* @throws \Swoole\Exception
58-
* @throws \Throwable
5958
*/
60-
publicfunction__construct(string$host,int$port,string$password ='',float$timeout =5.0)
59+
publicfunction__construct(string$host,int$port =6379,string$password ='',float$timeout =10.0)
6160
{
62-
$this->host=$host;
63-
$this->port=$port;
61+
$this->host =$host;
62+
$this->port =$port;
6463
$this->password =$password;
65-
$this->timeout=$timeout;
64+
$this->timeout =$timeout;
6665
$this->connect();
6766
}
6867

6968
/**
7069
* Connect
7170
* @throws \Swoole\Exception
72-
* @throws \Throwable
7371
*/
7472
protectedfunctionconnect()
7573
{
76-
$connection=newConnection($this->host,$this->port,$this->timeout);
74+
$connection =newConnection($this->host,$this->port,$this->timeout);
7775
$this->commandInvoker =newCommandInvoker($connection);
7876
if ('' != (string)$this->password) {
7977
$this->commandInvoker->invoke("auth{$this->password}",1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp