Skip to content

Commit

Permalink
Remove coroutine support for workerStop
Browse files Browse the repository at this point in the history
新版本的 Workerman 如果在 调用 stopAll 停服后,workerStop 事件中包含了 Fiber,会引起递归报错。
  • Loading branch information
crazywhalecc authored Jul 26, 2023
1 parent 12f7cfe commit b88f560
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/OneBot/Driver/Workerman/TopEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit b88f560

Please sign in to comment.