From b88f560291e1c29707390ae25cd1b80b08a75ef5 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Wed, 26 Jul 2023 20:25:00 +0800 Subject: [PATCH] Remove coroutine support for workerStop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新版本的 Workerman 如果在 调用 stopAll 停服后,workerStop 事件中包含了 Fiber,会引起递归报错。 --- src/OneBot/Driver/Workerman/TopEventListener.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/OneBot/Driver/Workerman/TopEventListener.php b/src/OneBot/Driver/Workerman/TopEventListener.php index b025511..3d7cea5 100644 --- a/src/OneBot/Driver/Workerman/TopEventListener.php +++ b/src/OneBot/Driver/Workerman/TopEventListener.php @@ -47,11 +47,7 @@ public function onWorkerStart(Worker $worker) */ public function onWorkerStop() { - if (($co = Adaptive::getCoroutine()) !== null) { - $co->create(fn () => ob_event_dispatcher()->dispatchWithHandler(new WorkerStopEvent())); - } else { - ob_event_dispatcher()->dispatchWithHandler(new WorkerStopEvent()); - } + ob_event_dispatcher()->dispatchWithHandler(new WorkerStopEvent()); } /**