From 2de5c82a733d698ac7baa66729f0cdf7b501832e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 6 Dec 2021 14:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kiri-engine/FileListen/HotReload.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index 71ed8b18..9c499c78 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -50,12 +50,19 @@ class HotReload extends Command /** - * @throws ConfigException - * @throws \ReflectionException */ protected function configure() { $this->setName('sw:wather')->setDescription('server start'); + } + + + /** + * @throws ConfigException + * @throws \ReflectionException + */ + protected function initCore() + { $this->dirs = Config::get('inotify', [APP_PATH . 'app']); swoole_async_set(['enable_coroutine' => false]); if (!extension_loaded('inotify')) { @@ -78,6 +85,7 @@ class HotReload extends Command */ public function execute(InputInterface $input, OutputInterface $output): int { + $this->initCore(); $this->trigger_reload(); Timer::tick(1000, fn() => $this->healthCheck());