diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index 2e4015e9..af4333c5 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -92,16 +92,13 @@ class OnWorkerStart extends Callback public function onSignal($server, $worker_id) { Coroutine::create(function ($server, $worker_id) { - while (true) { - $ret = Coroutine::waitSignal($this->signal, -1); - if ($ret) { - if (!Snowflake::app()->isRun()) { - break; - } - sleep(1); + while (Coroutine::waitSignal($this->signal, -1)) { + if (!Snowflake::app()->isRun()) { + break; } - return $server->stop($worker_id); + sleep(1); } + return $server->stop($worker_id); }, $server, $worker_id); } diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index 80b78693..e4b1b30d 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -46,6 +46,7 @@ class ServerInotify extends Process var_dump($this->dirs); + foreach ($this->dirs as $dir) { $this->watch($dir); }