改名
This commit is contained in:
@@ -157,7 +157,7 @@ class ServerManager
|
||||
* @param array $ports
|
||||
* @return array
|
||||
*/
|
||||
private function sortService(array $ports): array
|
||||
public function sortService(array $ports): array
|
||||
{
|
||||
$array = [];
|
||||
foreach ($ports as $port) {
|
||||
@@ -315,7 +315,8 @@ class ServerManager
|
||||
return;
|
||||
}
|
||||
while ($this->checkPortIsAlready($port)) {
|
||||
exec('kill ' . $pid, $execResult);
|
||||
exec('kill -15 ' . $pid, $execResult);
|
||||
Process::kill($pid,);
|
||||
usleep(300);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ class Server extends HttpService
|
||||
public function shutdown()
|
||||
{
|
||||
$configs = Config::get('server', [], true);
|
||||
foreach ($configs['ports'] ?? [] as $config) {
|
||||
foreach ($this->manager->sortService($configs) as $config) {
|
||||
$this->manager->stopServer($config['port']);
|
||||
}
|
||||
$this->eventDispatch->dispatch(new OnShutdown());
|
||||
|
||||
Reference in New Issue
Block a user