mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
update to 2.4.1 version (build 401)
fix startup warning bug
This commit is contained in:
@@ -20,8 +20,8 @@ use ZM\Utils\DataProvider;
|
||||
|
||||
class ConsoleApplication extends Application
|
||||
{
|
||||
const VERSION_ID = 400;
|
||||
const VERSION = "2.4.0";
|
||||
const VERSION_ID = 401;
|
||||
const VERSION = "2.4.1";
|
||||
|
||||
public function __construct(string $name = 'UNKNOWN') {
|
||||
define("ZM_VERSION_ID", self::VERSION_ID);
|
||||
|
||||
@@ -340,18 +340,22 @@ class Framework
|
||||
foreach ($args as $x => $y) {
|
||||
switch ($x) {
|
||||
case 'worker-num':
|
||||
if (intval($y) >= 1 && intval($y) <= 1024) {
|
||||
$this->server_set["worker_num"] = intval($y);
|
||||
} else {
|
||||
Console::warning("Invalid worker num! Turn to default value (".($this->server_set["worker_num"] ?? swoole_cpu_num()).")");
|
||||
if ($y) {
|
||||
if (intval($y) >= 1 && intval($y) <= 1024) {
|
||||
$this->server_set["worker_num"] = intval($y);
|
||||
} else {
|
||||
Console::warning("Invalid worker num! Turn to default value (".($this->server_set["worker_num"] ?? swoole_cpu_num()).")");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'task-worker-num':
|
||||
if (intval($y) >= 1 && intval($y) <= 1024) {
|
||||
$this->server_set["task_worker_num"] = intval($y);
|
||||
$this->server_set["task_enable_coroutine"] = true;
|
||||
} else {
|
||||
Console::warning("Invalid worker num! Turn to default value (0)");
|
||||
if ($y) {
|
||||
if (intval($y) >= 1 && intval($y) <= 1024) {
|
||||
$this->server_set["task_worker_num"] = intval($y);
|
||||
$this->server_set["task_enable_coroutine"] = true;
|
||||
} else {
|
||||
Console::warning("Invalid worker num! Turn to default value (0)");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'disable-coroutine':
|
||||
|
||||
@@ -35,7 +35,6 @@ class ZMAtomic
|
||||
for($i = 0; $i < ZM_WORKER_NUM; ++$i) {
|
||||
self::$atomics["_#worker_".$i] = new Atomic(0);
|
||||
}
|
||||
echo ("初始化工作进程数量:".ZM_WORKER_NUM.PHP_EOL);
|
||||
for ($i = 0; $i < 10; ++$i) {
|
||||
self::$atomics["_tmp_" . $i] = new Atomic(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user