From 981a800053edd145abebb4d16d6e95ee3f211162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 5 Nov 2021 14:44: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 --- kiri-engine/FileListen/FileChangeCustomProcess.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 59004920..27864477 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -8,6 +8,7 @@ use Kiri\Abstracts\Logger; use Kiri\Exception\ConfigException; use Kiri\Kiri; use Swoole\Coroutine; +use Swoole\Process; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -67,6 +68,11 @@ class FileChangeCustomProcess extends Command swoole_set_process_name('[' . Config::get('id', 'sw service.') . '].sw:wather'); } + Process::signal(SIGKILL | SIGTERM, function ($data) use ($driver) { + $driver->clear(); + $this->stop(); + }); + $this->trigger_reload(); Coroutine::create(function () use ($driver) { $driver->start();