1
This commit is contained in:
@@ -176,7 +176,6 @@ class HotReload extends Command
|
|||||||
Timer::clearAll();
|
Timer::clearAll();
|
||||||
$this->driver->clear();
|
$this->driver->clear();
|
||||||
$this->stopServer();
|
$this->stopServer();
|
||||||
$this->stopManager();
|
|
||||||
while ($ret = Process::wait(TRUE)) {
|
while ($ret = Process::wait(TRUE)) {
|
||||||
echo "PID={$ret['pid']}\n";
|
echo "PID={$ret['pid']}\n";
|
||||||
sleep(1);
|
sleep(1);
|
||||||
@@ -193,20 +192,13 @@ class HotReload extends Command
|
|||||||
if (!empty($pid) && Process::kill($pid, 0)) {
|
if (!empty($pid) && Process::kill($pid, 0)) {
|
||||||
Process::kill($pid, SIGTERM);
|
Process::kill($pid, SIGTERM);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
protected function stopManager()
|
|
||||||
{
|
|
||||||
if ($this->process && Process::kill($this->process->pid, 0)) {
|
if ($this->process && Process::kill($this->process->pid, 0)) {
|
||||||
Process::kill($this->process->pid) && Process::wait(TRUE);
|
Process::kill($this->process->pid) && Process::wait(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重启
|
* 重启
|
||||||
*
|
*
|
||||||
@@ -221,8 +213,6 @@ class HotReload extends Command
|
|||||||
$this->logger->warning('change reload');
|
$this->logger->warning('change reload');
|
||||||
|
|
||||||
$this->stopServer();
|
$this->stopServer();
|
||||||
$this->stopManager();
|
|
||||||
|
|
||||||
$this->process = new Process(function (Process $process) {
|
$this->process = new Process(function (Process $process) {
|
||||||
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "start"]);
|
$process->exec(PHP_BINARY, [APP_PATH . "kiri.php", "sw:server", "start"]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user