From b88f560291e1c29707390ae25cd1b80b08a75ef5 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Wed, 26 Jul 2023 20:25:00 +0800 Subject: [PATCH 1/2] 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()); } /** From cb770038a015665792cbd87c1516a58ad3f303d7 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Wed, 26 Jul 2023 20:26:21 +0800 Subject: [PATCH 2/2] update version to 0.6.5 --- src/OneBot/global_defines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OneBot/global_defines.php b/src/OneBot/global_defines.php index 8b6a68a..02d3fd9 100644 --- a/src/OneBot/global_defines.php +++ b/src/OneBot/global_defines.php @@ -13,7 +13,7 @@ use ZM\Logger\ConsoleLogger; const ONEBOT_VERSION = '12'; -const ONEBOT_LIBOB_VERSION = '0.6.4'; +const ONEBOT_LIBOB_VERSION = '0.6.5'; const ONEBOT_JSON = 1; const ONEBOT_MSGPACK = 2;