This commit is contained in:
2021-08-17 18:53:37 +08:00
parent 37392bb6f0
commit d5f9df7a08
+7 -1
View File
@@ -68,9 +68,15 @@ class PDO
*/
public function heartbeat_check(): void
{
if (env('state') == 'exit') {
return;
}
if ($this->_timer === -1 && Context::inCoroutine()) {
$this->_timer = Timer::tick(3000, function () {
$this->_timer = Timer::tick(1000, function () {
try {
if (env('state') == 'exit') {
$this->stopHeartbeatCheck();
}
if (time() - $this->_last > 10 * 60) {
$this->stopHeartbeatCheck();
$this->pdo = null;