From 0c4c9735705b59d0a6f1e222b6e4e42e18b35e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 22 Jun 2022 18:58:26 +0800 Subject: [PATCH] modify plugin name --- Abstracts/AsyncServer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Abstracts/AsyncServer.php b/Abstracts/AsyncServer.php index 0b1d2f0..7b25115 100644 --- a/Abstracts/AsyncServer.php +++ b/Abstracts/AsyncServer.php @@ -182,7 +182,6 @@ class AsyncServer implements ServerInterface */ public function onSignal(array $signal): void { - pcntl_signal(SIGTERM, [$this, 'onSigint']); pcntl_signal(SIGINT, [$this, 'onSigint']); foreach ($signal as $sig => $value) { if (is_array($value) && is_string($value[0])) { @@ -197,12 +196,14 @@ class AsyncServer implements ServerInterface /** + * @param $no + * @param array $signInfo * @return void */ - public function onSigint(): void + public function onSigint($no, array $signInfo): void { try { - file_put_contents('php://output', Json::encode(func_get_args())); + $this->logger->alert('Pid ' . getmypid() . ' get signo ' . $no, $signInfo); $this->shutdown(); } catch (\Throwable $exception) { $this->logger->error($exception->getMessage());