diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 59004920..27864477 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -8,6 +8,7 @@ use Kiri\Abstracts\Logger; use Kiri\Exception\ConfigException; use Kiri\Kiri; use Swoole\Coroutine; +use Swoole\Process; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -67,6 +68,11 @@ class FileChangeCustomProcess extends Command swoole_set_process_name('[' . Config::get('id', 'sw service.') . '].sw:wather'); } + Process::signal(SIGKILL | SIGTERM, function ($data) use ($driver) { + $driver->clear(); + $this->stop(); + }); + $this->trigger_reload(); Coroutine::create(function () use ($driver) { $driver->start();