This commit is contained in:
2023-04-19 13:15:21 +08:00
parent c739912494
commit 3b0d556700
5 changed files with 30 additions and 19 deletions
+5 -5
View File
@@ -142,8 +142,6 @@ class AsyncServer implements ServerInterface
/**
* @param SConfig $config
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function addListener(SConfig $config): void
@@ -217,12 +215,14 @@ class AsyncServer implements ServerInterface
/**
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
* @throws
*/
public function start(): void
{
$pid = (int)file_get_contents(storage('.swoole.pid'));
if (posix_kill($pid, 0)) {
posix_kill($pid, SIGTERM);
}
$processManager = Kiri::getDi()->get(EventDispatch::class);
$processManager->dispatch(new OnServerBeforeStart());
$this->server->start();