This commit is contained in:
2021-08-17 18:46:56 +08:00
parent a943a6ca25
commit 5ba5c930a0
+2 -2
View File
@@ -40,7 +40,7 @@ class Server extends HttpService
private mixed $daemon = 0; private mixed $daemon = 0;
/** @var EventDispatch */ /** @var EventDispatch */
#[Inject(EventDispatch::class)] #[Inject(EventDispatch::class)]
public EventDispatch $eventDispatch; public EventDispatch $eventDispatch;
@@ -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 ($this->manager->sortService($configs) as $config) { foreach ($this->manager->sortService($configs['ports'] ?? []) as $config) {
$this->manager->stopServer($config['port']); $this->manager->stopServer($config['port']);
} }
$this->eventDispatch->dispatch(new OnShutdown()); $this->eventDispatch->dispatch(new OnShutdown());