Compare commits

...

1 Commits
2.4.0 ... 2.4.1

Author SHA1 Message Date
jerry
bbe4addd83 update to 2.4.1 version (build 401)
fix startup warning bug
2021-03-25 17:11:35 +08:00
4 changed files with 21 additions and 12 deletions

View File

@@ -1,5 +1,11 @@
# 更新日志v2 版本)
## v2.4.1 (build 401)
> 更新时间2021.3.25
- 修复:开启框架时导致的报错
## v2.4.0build 400
> 更新时间2021.3.25

View File

@@ -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);

View File

@@ -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':

View File

@@ -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);
}