This commit is contained in:
as2252258@163.com
2021-09-04 00:08:33 +08:00
parent fe3e947632
commit d8584132d2
+2 -2
View File
@@ -72,13 +72,13 @@ class PDO implements StopHeartbeatCheck
*/ */
public function heartbeat_check(): void public function heartbeat_check(): void
{ {
if (env('state') == 'exit') { if (env('state','start') == 'exit') {
return; return;
} }
if ($this->_timer === -1 && Context::inCoroutine()) { if ($this->_timer === -1 && Context::inCoroutine()) {
$this->_timer = Timer::tick(1000, function () { $this->_timer = Timer::tick(1000, function () {
try { try {
if (env('state') == 'exit') { if (env('state','start') == 'exit') {
echo 'timer end.' . PHP_EOL; echo 'timer end.' . PHP_EOL;
$this->stopHeartbeatCheck(); $this->stopHeartbeatCheck();
} }