Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ca39d2205 | |||
| 908c8719d3 | |||
| 69b845d924 |
@@ -74,7 +74,7 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server
|
||||
try {
|
||||
$this->dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId));
|
||||
if ($workerId < $server->setting['worker_num']) {
|
||||
CoordinatorManager::utility(Coordinator::WORKER_START)->waite();
|
||||
CoordinatorManager::utility(Coordinator::WORKER_START)->wait();
|
||||
|
||||
$this->dispatch->dispatch(new OnWorkerStart($server, $workerId));
|
||||
} else {
|
||||
|
||||
+21
-17
@@ -125,22 +125,26 @@ class ServerCommand extends Command
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @return int
|
||||
* @throws
|
||||
*/
|
||||
protected function start(InputInterface $input): int
|
||||
{
|
||||
$this->asyncServer->addProcess(config('process', []));
|
||||
if (\config('servers.reload.hot', false) === true) {
|
||||
$this->asyncServer->addProcess([FileWatcher::class]);
|
||||
} else {
|
||||
di(Router::class)->scan_build_route();
|
||||
}
|
||||
$this->asyncServer->initCoreServers(config('servers.server', []), (int)$input->getOption('daemon'));
|
||||
$this->asyncServer->start();
|
||||
return 1;
|
||||
}
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @return int
|
||||
* @throws
|
||||
*/
|
||||
protected function start(InputInterface $input): int
|
||||
{
|
||||
$this->asyncServer->addProcess(config('process', []));
|
||||
$hotReload = \config('servers.reload.hot', false) === true;
|
||||
if ($hotReload) {
|
||||
$this->asyncServer->addProcess([FileWatcher::class]);
|
||||
}
|
||||
if (!$hotReload) {
|
||||
// 非热更模式可在 Master 进程预扫描,Worker 通过 fork 继承扫描结果。
|
||||
// 热更模式必须让新 Worker 自己加载业务类,避免继承旧类定义后无法重新声明。
|
||||
di(Router::class)->scan_build_route();
|
||||
}
|
||||
$this->asyncServer->initCoreServers(config('servers.server', []), (int)$input->getOption('daemon'));
|
||||
$this->asyncServer->start();
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.4",
|
||||
"php": ">=8.5",
|
||||
"ext-json": "*",
|
||||
"composer-runtime-api": "^2.0",
|
||||
"psr/http-server-middleware": "^1.0",
|
||||
|
||||
Reference in New Issue
Block a user