From 536821d95d01b3cee7a2d7a1bb1afa04840bb8f4 Mon Sep 17 00:00:00 2001 From: as2252258 Date: Sun, 10 Apr 2022 03:53:21 +0800 Subject: [PATCH] modify mysql result --- Inotify.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Inotify.php b/Inotify.php index adfc5f4..c9f8bf9 100644 --- a/Inotify.php +++ b/Inotify.php @@ -3,6 +3,7 @@ namespace Kiri\Server; use Exception; +use Kiri\Abstracts\Config; use Kiri\Annotation\Inject; use Kiri\Error\StdoutLoggerInterface; use Kiri\Server\Abstracts\BaseProcess; @@ -45,12 +46,29 @@ class Inotify extends BaseProcess set_error_handler([$this, 'error']); set_exception_handler([$this, 'error']); - $this->dirs = [CONTROLLER_PATH, MODEL_PATH, APP_PATH . 'routes', APP_PATH . 'vendor/game-worker']; + if (!extension_loaded('inotify')) { + $this->cid = Timer::tick(1000, function () { + + }); + return; + } + + $this->dirs = Config::get('inotify', []); $this->start(); } + public function onSigterm(): static + { + Timer::clear($this->cid); + + $this->isStop = true; + + return parent::onSigterm(); // TODO: Change the autogenerated stub + } + + /** * @return void */