From 79b32df2d5512482f36a78099b46bbd773ecc817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 4 Nov 2021 19:00:53 +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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 9fb35303..3310e81c 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -104,10 +104,12 @@ class FileChangeCustomProcess extends Command { Kiri::getDi()->get(Logger::class)->warning('change reload'); - $content = file_get_contents(storage('.swoole.pid')); + $content = (int)file_get_contents(storage('.swoole.pid')); if (!empty($content)) { - var_dump($content); - Process::kill((int)$content, SIGTERM); + var_dump($content, Process::kill($content, 0)); + if (Process::kill($content, 0)) { + Process::kill($content, SIGTERM); + } } proc_open("php " . APP_PATH . "kiri.php", [], $pipes); }