From a2a1699ef67b1839863e42be676820c09a31a1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 31 Mar 2023 10:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Handler/OnServerWorker.php | 3 --- Server.php | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Handler/OnServerWorker.php b/Handler/OnServerWorker.php index c4831b1..1d8b0bb 100644 --- a/Handler/OnServerWorker.php +++ b/Handler/OnServerWorker.php @@ -57,9 +57,6 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server */ public function onWorkerStart(Server $server, int $workerId): void { - if ($server->setting[Constant::OPTION_ENABLE_COROUTINE] ?? false) { - Runtime::enableCoroutine(); - } $this->dispatch->dispatch(new OnBeforeWorkerStart($workerId)); set_env('environmental_workerId', $workerId); $this->status->setEnum(StatusEnum::START); diff --git a/Server.php b/Server.php index d8db88f..32f2a11 100644 --- a/Server.php +++ b/Server.php @@ -77,7 +77,7 @@ class Server extends HttpService return; } Coroutine::set([ - 'hook_flags' => SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_BLOCKING_FUNCTION, + 'hook_flags' => (SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL) ^ SWOOLE_HOOK_BLOCKING_FUNCTION, 'enable_deadlock_check' => FALSE, 'exit_condition' => function () { return Coroutine::stats()['coroutine_num'] === 0;