From b7bdf12b50b4794d07867be964af15c2fbd1c893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 15 Oct 2020 11:52:30 +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 --- HttpServer/Action.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/HttpServer/Action.php b/HttpServer/Action.php index a7a93c15..93e0c052 100644 --- a/HttpServer/Action.php +++ b/HttpServer/Action.php @@ -76,7 +76,9 @@ trait Action { echo 'waite.'; while ($server->isRunner()) { - $this->masterIdCheck(); + if (!$this->masterIdCheck()) { + break; + } usleep(100); } echo PHP_EOL; @@ -90,6 +92,9 @@ trait Action { echo '.'; $files = new \DirectoryIterator($this->getWorkerPath()); + if ($files->getSize() < 1) { + return false; + } foreach ($files as $file) { $content = file_get_contents($file->getRealPath()); exec("ps -ax | awk '{ print $1 }' | grep -e '^{$content}$'", $output); @@ -99,6 +104,7 @@ trait Action @unlink($file->getRealPath()); } } + return true; }