prevent server:stop command error when daemon file not exists

This commit is contained in:
crazywhalecc
2022-05-06 23:36:29 +08:00
parent 19c792209b
commit e843aeac55

View File

@@ -43,7 +43,9 @@ class ServerStopCommand extends DaemonCommand
} else {
parent::execute($input, $output);
}
Process::kill(intval($this->daemon_file['pid']), SIGTERM);
if ($this->daemon_file !== null) {
Process::kill(intval($this->daemon_file['pid']), SIGTERM);
}
$i = 10;
while (Framework::getProcessState(ZM_PROCESS_MASTER) !== false && $i > 0) {
sleep(1);