enhancement for process state

This commit is contained in:
crazywhalecc
2022-03-13 22:46:22 +08:00
parent e95925c129
commit 3c87abc6e8
8 changed files with 179 additions and 55 deletions

View File

@@ -6,7 +6,7 @@ namespace ZM\Command\Daemon;
use Swoole\Process;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use ZM\Utils\DataProvider;
use ZM\Framework;
class DaemonStopCommand extends DaemonCommand
{
@@ -20,7 +20,7 @@ class DaemonStopCommand extends DaemonCommand
parent::execute($input, $output);
Process::kill(intval($this->daemon_file["pid"]), SIGTERM);
$i = 10;
while (file_exists(DataProvider::getWorkingDir() . "/.daemon_pid") && $i > 0) {
while (Framework::getProcessState(ZM_PROCESS_MASTER) !== false && $i > 0) {
sleep(1);
--$i;
}