This commit is contained in:
2023-04-19 14:37:25 +08:00
parent 28e7e5dc81
commit 6c21470dbb
+3 -3
View File
@@ -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;
}