diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index fb11b3b3..f7784ff2 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -39,9 +39,9 @@ class OnWorkerStart extends Callback { Coroutine::set([ 'enable_deadlock_check' => false, -// 'exit_condition' => function () { -// return Coroutine::stats()['coroutine_num'] === 0; -// } + // 'exit_condition' => function () { + // return Coroutine::stats()['coroutine_num'] === 0; + // } ]); putenv('workerId=' . $worker_id); @@ -62,7 +62,6 @@ class OnWorkerStart extends Callback } - /** * @param $server * @param $worker_id @@ -72,7 +71,7 @@ class OnWorkerStart extends Callback Coroutine\go(function (Server $server, $worker_id) { $sigkill = Coroutine::waitSignal(SIGTERM | SIGKILL | SIGUSR2 | SIGUSR1); if ($sigkill !== false) { - return $server->stop(); + return $server->stop(-1, true); } do { $number = Co::stats()['coroutine_num']; @@ -82,7 +81,7 @@ class OnWorkerStart extends Callback } Coroutine::sleep(0.01); } while (true); - return $server->stop(); + return $server->stop(-1, true); }, $server, $worker_id); }