变更
This commit is contained in:
+3
-3
@@ -39,9 +39,6 @@ class HotReload extends Command
|
|||||||
{
|
{
|
||||||
$this->setName('hot:load');
|
$this->setName('hot:load');
|
||||||
parent::configure(); // TODO: Change the autogenerated stub
|
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
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$this->startProcess();
|
$this->startProcess();
|
||||||
|
Process::signal(SIGINT, fn() => $this->exit());
|
||||||
|
Process::signal(SIGTERM, fn() => $this->exit());
|
||||||
sleep(3);
|
sleep(3);
|
||||||
if (extension_loaded('inotify')) {
|
if (extension_loaded('inotify')) {
|
||||||
$this->onInotifyReload();
|
$this->onInotifyReload();
|
||||||
@@ -74,6 +73,7 @@ class HotReload extends Command
|
|||||||
public function exit(): void
|
public function exit(): void
|
||||||
{
|
{
|
||||||
$this->stopProcess();
|
$this->stopProcess();
|
||||||
|
$this->isExit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user