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