From 6d242d42b00e0e26ff5d6f58221faf0421cc44af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 2 Dec 2021 15:36:54 +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 --- src/RpcJsonp.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/RpcJsonp.php b/src/RpcJsonp.php index 303d398..30f956a 100644 --- a/src/RpcJsonp.php +++ b/src/RpcJsonp.php @@ -97,7 +97,11 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa if ($server->workerId != 0) { return; } - Timer::tick(1000, static function () { + Timer::tick(1000, static function ($timeId) { + if (env('state', 'start') == 'exit') { + Timer::clear($timeId); + return; + } Kiri::getDi()->get(RpcManager::class)->tick(); }); }