From 3e256e5093a447353d2d57a420b3c0c81f13f709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 17 Aug 2021 18:53:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Cache/Base/Redis.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/System/Cache/Base/Redis.php b/System/Cache/Base/Redis.php index c5ba6dc1..e7d1b5ef 100644 --- a/System/Cache/Base/Redis.php +++ b/System/Cache/Base/Redis.php @@ -61,9 +61,15 @@ class Redis */ public function heartbeat_check(): void { + if (env('state') == 'exit') { + return; + } if ($this->_timer === -1 && Context::inCoroutine()) { $this->_timer = Timer::tick(3000, function () { try { + if (env('state') == 'exit') { + $this->stopHeartbeatCheck(); + } if (time() - $this->_last > 10 * 60) { $this->stopHeartbeatCheck(); $this->pdo = null;