diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index f4c8b1bd..f44a3fd1 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -64,6 +64,16 @@ class FileChangeCustomProcess extends Command $driver = Kiri::getDi()->get(Inotify::class, [$this->dirs, $this]); } $make = Barrier::make(); + go(function () { + $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", + [ + 0 => ["pipe", "r"], // 标准输入,子进程从此管道中读取数据 + 1 => ["pipe", "w"], // 标准输出,子进程向此管道中写入数据 + 2 => ["file", "/tmp/error-output.txt", "a"] // 标准错误,写入到一个文件 + ] + , $this->pipes); + var_dump($this->source, $this->pipes); + }); go(function () { $sign = Coroutine::waitSignal(SIGTERM, -1); if ($sign) { @@ -73,17 +83,6 @@ class FileChangeCustomProcess extends Command go(function () use ($driver) { $driver->start(); }); - go(function () { - $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", - [ - 0 => ["pipe", "r"], // 标准输入,子进程从此管道中读取数据 - 1 => ["pipe", "w"], // 标准输出,子进程向此管道中写入数据 - 2 => ["file", "/tmp/error-output.txt", "a"] // 标准错误,写入到一个文件 - ] - , $this->pipes); - }); - - var_dump($this->source, $this->pipes); Barrier::wait($make); return 0; }