From 81eeaa64e461ee55160e05fb08d20375ad79217c Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Nov 2021 00:25:47 +0800 Subject: [PATCH] 111 --- kiri-engine/FileListen/FileChangeCustomProcess.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 931c0ee8..7f077368 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -34,6 +34,8 @@ class FileChangeCustomProcess extends Command protected mixed $source = null; protected mixed $pipes = []; + protected Coroutine\Channel $channel; + /** * @@ -42,7 +44,10 @@ class FileChangeCustomProcess extends Command { $this->setName('sw:wather') ->setDescription('server start'); - } + + $this->channel = new Coroutine\Channel(1); + $this->channel->push(true); + } @@ -98,7 +103,11 @@ class FileChangeCustomProcess extends Command Process::kill($content, SIGTERM); } Coroutine::create(function () { + $this->channel->pop(); + proc_open("php " . APP_PATH . "kiri.php", [], $pipes); + + $this->channel->push(1); }); }