This commit is contained in:
2025-12-18 15:39:40 +08:00
parent 37b59c8536
commit 968cdbd11a
7 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -92,7 +92,7 @@ class AsyncServer extends Component implements ServerInterface
$config->events[Constant::SHUTDOWN] = [OnServer::class, 'onShutdown'];
}
$this->event($this->server, array_merge(\config('server.events', []), $config->events));
$this->event($this->server, array_merge(\config('servers.server.events', []), $config->events));
$this->container->bind(ServerInterface::class, $this->server);
return $service;
}
@@ -106,7 +106,7 @@ class AsyncServer extends Component implements ServerInterface
*/
protected function systemConfig(SConfig $config, int $daemon): array
{
$settings = array_merge(\config('server.settings', []), $config->settings);
$settings = array_merge(\config('servers.server.settings', []), $config->settings);
$settings[Constant::OPTION_DAEMONIZE] = (bool)$daemon;
$settings[Constant::OPTION_ENABLE_REUSE_PORT] = true;
$settings[Constant::OPTION_PID_FILE] = storage('.swoole.pid');
+3 -3
View File
@@ -113,7 +113,7 @@ class HotReload extends AbstractProcess
}
$this->reloading = true;
di(StdoutLogger::class)->println('reloading server[' . \config('id', 'system-service') . '], please waite.');
di(StdoutLogger::class)->println('reloading server[' . \config('site.id', 'system-service') . '], please waite.');
$this->clear();
di(ServerInterface::class)->reload();
@@ -128,7 +128,7 @@ class HotReload extends AbstractProcess
*/
protected function addListen(): void
{
foreach (config('reload.listen') as $value) {
foreach (config('servers.reload.listen') as $value) {
$this->readDirectory($value);
}
}
@@ -168,4 +168,4 @@ class HotReload extends AbstractProcess
}
}
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ trait TraitServer
*/
public function onSignal(): void
{
$signal = \config('signal', []);
$signal = \config('servers.signal', []);
$this->onPcntlSignal(SIGINT, [$this, 'onSigint']);
foreach ($signal as $sig => $value) {
if (is_array($value) && is_string($value[0])) {