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; }