From 6c21470dbba3d164141e6e691f383f76d7ca6c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 19 Apr 2023 14:37:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HotReload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HotReload.php b/HotReload.php index 3fd75f4..43d9c00 100644 --- a/HotReload.php +++ b/HotReload.php @@ -39,9 +39,6 @@ class HotReload extends Command { $this->setName('hot:load'); parent::configure(); // TODO: Change the autogenerated stub - - Process::signal(SIGINT, fn() => $this->exit()); - Process::signal(SIGTERM, fn() => $this->exit()); } @@ -57,6 +54,8 @@ class HotReload extends Command protected function execute(InputInterface $input, OutputInterface $output): int { $this->startProcess(); + Process::signal(SIGINT, fn() => $this->exit()); + Process::signal(SIGTERM, fn() => $this->exit()); sleep(3); if (extension_loaded('inotify')) { $this->onInotifyReload(); @@ -74,6 +73,7 @@ class HotReload extends Command public function exit(): void { $this->stopProcess(); + $this->isExit = true; }