modify plugin name

This commit is contained in:
2022-02-16 10:38:58 +08:00
parent a75561a415
commit 8cd3886494
+11 -14
View File
@@ -203,21 +203,18 @@ class HotReload extends Command
*/
public function trigger_reload(string $path = '')
{
$this->logger->warning('restart');
if (!empty($path) && str_starts_with($path, CONTROLLER_PATH)) {
$pid = file_get_contents(storage('.swoole.pid'));
if (!empty($pid) && Process::kill($pid, 0)) {
Process::kill($pid, SIGUSR1);
}
} else {
$this->int = 1;
$this->stopServer();
$this->process = new Process(function (Process $process) {
Kiri::app()->getServer()->start();
});
$this->process->start();
$this->int = -1;
if ($this->int == 1) {
return;
}
$this->int = 1;
$this->logger->warning('restart');
$this->stopServer();
$this->process = new Process(function (Process $process) {
Kiri::app()->getServer()->start();
});
$this->process->start();
$this->int = -1;
}