From f0e2ddf0f79a40e16b4eb0b21efc1b49648729ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 2 Mar 2021 15:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnWorkerStart.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index fec46ec4..723d5197 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -22,6 +22,11 @@ use Swoole\Server; class OnWorkerStart extends Callback { + /** @var int 重启信号 */ + private int $signal = SIGUSR1 | SIGKILL | SIGKILL; + + + /** * @param Server $server * @param int $worker_id @@ -41,6 +46,7 @@ class OnWorkerStart extends Callback } $this->debug(sprintf('%s #%d Pid:%d start.', ucfirst(env('environmental')), $worker_id, $server->worker_pid)); + Coroutine\go([$this, 'onSignal'], $server, $worker_id); }