Skip to content

Commit

Permalink
chore: 增加通过环境变量WEBMAN_WORKERS修改Webman的worker数的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
xboard committed Apr 7, 2024
1 parent 2ee630e commit bb708d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webman.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
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) {
Expand Down

0 comments on commit bb708d6

Please sign in to comment.