diff --git a/src/Mysql/PDO.php b/src/Mysql/PDO.php index 57ec411..9e77827 100644 --- a/src/Mysql/PDO.php +++ b/src/Mysql/PDO.php @@ -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;