Commit 3ff71adf by HanSon Committed by GitHub

Merge pull request #22 from HanSon/dev

修改超时设置
2 parents d023f430 8ecc3db8
...@@ -130,16 +130,16 @@ class MessageHandler ...@@ -130,16 +130,16 @@ class MessageHandler
list($retCode, $selector) = $this->sync->checkSync(); list($retCode, $selector) = $this->sync->checkSync();
if(in_array($retCode, ['1100', '1101'])){ # 微信客户端上登出或者其他设备登录 if(in_array($retCode, ['1100', '1101'])){ # 微信客户端上登出或者其他设备登录
Console::log('[INFO] 微信客户端正常退出');
if($this->exitHandler){ if($this->exitHandler){
Console::log('[INFO] 微信客户端正常退出');
call_user_func_array($this->exitHandler, []); call_user_func_array($this->exitHandler, []);
} }
break; break;
}elseif ($retCode == 0){ }elseif ($retCode == 0){
$this->handlerMessage($selector); $this->handlerMessage($selector);
}else{ }else{
Console::log('[INFO] 微信客户端异常退出');
if($this->exceptionHandler){ if($this->exceptionHandler){
Console::log('[INFO] 微信客户端异常退出');
call_user_func_array($this->exitHandler, []); call_user_func_array($this->exitHandler, []);
} }
break; break;
......
...@@ -32,7 +32,7 @@ class Sync ...@@ -32,7 +32,7 @@ class Sync
]); ]);
try{ try{
$content = http()->get($url); $content = http()->get($url, [], ['connect_timeout' => 60]);
preg_match('/window.synccheck=\{retcode:"(\d+)",selector:"(\d+)"\}/', $content, $matches); preg_match('/window.synccheck=\{retcode:"(\d+)",selector:"(\d+)"\}/', $content, $matches);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!