mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48:14 -05:00
chore: 增加通过环境变量WEBMAN_WORKERS修改Webman的worker数的功能
This commit is contained in:
parent
2ee630e94c
commit
bb708d6084
@ -7,12 +7,12 @@ use Workerman\Worker;
|
|||||||
Adapterman::init();
|
Adapterman::init();
|
||||||
|
|
||||||
$http_worker = new Worker('http://127.0.0.1:7010');
|
$http_worker = new Worker('http://127.0.0.1:7010');
|
||||||
$http_worker->count = swoole_cpu_num() ?? 2;
|
$http_worker->count = getenv('WEBMAN_WORKERS') ?? (swoole_cpu_num() ?? 1);
|
||||||
$http_worker->name = 'AdapterMan';
|
$http_worker->name = 'AdapterMan';
|
||||||
|
|
||||||
$http_worker->onWorkerStart = static function () {
|
$http_worker->onWorkerStart = static function () {
|
||||||
//init();
|
//init();
|
||||||
require __DIR__.'/start.php';
|
require __DIR__ . '/start.php';
|
||||||
};
|
};
|
||||||
|
|
||||||
$http_worker->onMessage = static function ($connection, $request) {
|
$http_worker->onMessage = static function ($connection, $request) {
|
||||||
|
Loading…
Reference in New Issue
Block a user