From bb708d608434421e2e16691a240e7bbdc983c2d4 Mon Sep 17 00:00:00 2001 From: xboard Date: Sun, 7 Apr 2024 22:23:34 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8FWEBMAN=5FWORKERS=E4=BF=AE?= =?UTF-8?q?=E6=94=B9Webman=E7=9A=84worker=E6=95=B0=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webman.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webman.php b/webman.php index 9ebc777..1cd5d9d 100644 --- a/webman.php +++ b/webman.php @@ -7,12 +7,12 @@ use Workerman\Worker; Adapterman::init(); $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->onWorkerStart = static function () { //init(); - require __DIR__.'/start.php'; + require __DIR__ . '/start.php'; }; $http_worker->onMessage = static function ($connection, $request) {