Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

定时器 #26

Closed
yangw1990 opened this issue Aug 4, 2017 · 3 comments
Closed

定时器 #26

yangw1990 opened this issue Aug 4, 2017 · 3 comments

Comments

@yangw1990
Copy link

我开了一个定时器,是从上午9点到晚上12点的范围,没有规定最大次数,然后每300秒去做一些事情,可是到第二天的9点开始,每跑一次定时器,数据库报一次错,
[2017-08-04 09:08:01] SD.ERROR: WORKER Error PDO::prepare(): MySQL server has gone away (/var/www/SwooleDistributed/src/Server/Asyn/Mysql/Miner.php:2487) [] []
[2017-08-04 09:08:01] SD.ERROR: WORKER Error PDO::prepare(): MySQL server has gone away (/var/www/SwooleDistributed/src/Server/Asyn/Mysql/Miner.php:2487) [] []
请问是什么原因呢?

@tmtbe
Copy link
Collaborator

tmtbe commented Aug 4, 2017

你的mysql连接断了

@tmtbe tmtbe closed this as completed Aug 4, 2017
@yangw1990
Copy link
Author

可以断开,怎么重新链接呢?

@yangw1990
Copy link
Author

if ($client->errno == 2006 || $client->errno == 2013) {//断线重连
$this->reconnect($client);

看源码中已经有断线重连的代码,可为什么还会报错呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants