校区服务

This commit is contained in:
Aether
2025-09-18 15:54:38 +08:00
parent 0920cef866
commit 30e00c5949
15 changed files with 486 additions and 240 deletions

View File

@@ -15,29 +15,29 @@ use function Hyperf\Support\env;
return [
'mode' => SWOOLE_PROCESS,
'servers' => [
[
'name' => 'jsonrpc-http',
'type' => Server::SERVER_HTTP,
'host' => env('JSON_RPC_HOST', '0.0.0.0'),
'port' => (int) env('JSON_RPC_PORT', 9620),
'sock_type' => SWOOLE_SOCK_TCP,
'callbacks' => [
Event::ON_REQUEST => [HttpServer::class, 'onRequest'],
],
'settings' => [
'open_eof_split' => true,
'package_eof' => "\r\n",
'package_max_length' => 1024 * 1024 * 2,
],
'options' => [
// Whether to enable request lifecycle event
'enable_request_lifecycle' => false,
],
],
[
'name' => 'jsonrpc-http',
'type' => Server::SERVER_HTTP,
'host' => env('JSON_RPC_HOST', '0.0.0.0'),
'port' => (int) env('JSON_RPC_PORT', 9620),
'sock_type' => SWOOLE_SOCK_TCP,
'callbacks' => [
Event::ON_REQUEST => [HttpServer::class, 'onRequest'],
],
'settings' => [
'open_eof_split' => true,
'package_eof' => "\r\n",
'package_max_length' => 1024 * 1024 * 2,
],
'options' => [
// Whether to enable request lifecycle event
'enable_request_lifecycle' => false,
],
],
],
'settings' => [
Constant::OPTION_ENABLE_COROUTINE => true,
Constant::OPTION_WORKER_NUM => (int) env('SWOOLE_WORKER_NUM', swoole_cpu_num()), //swoole_cpu_num(),
Constant::OPTION_WORKER_NUM => (int) env('SWOOLE_WORKER_NUM', swoole_cpu_num()), // swoole_cpu_num(),
Constant::OPTION_PID_FILE => BASE_PATH . '/runtime/hyperf.pid',
Constant::OPTION_OPEN_TCP_NODELAY => true,
Constant::OPTION_MAX_COROUTINE => 100000,
@@ -51,4 +51,10 @@ return [
Event::ON_PIPE_MESSAGE => [PipeMessageCallback::class, 'onPipeMessage'],
Event::ON_WORKER_EXIT => [WorkerExitCallback::class, 'onWorkerExit'],
],
// 健康检查配置供Nacos检测服务状态
'health_check' => [
'enable' => true,
'path' => '/health',
'interval' => 3,
],
];