feat: confs2 C++20 重写替代 Python confs,时间戳改系统时区
- 新增 confs2/:C++20 重写统一配置服务(libmsg RpcServer) - main.cpp: ConfigStore + 4 路由(get/list/reload/health) + INI/JSON 按键取值 - LogC.hpp: 异步日志客户端(含 P2-3 日志注入防护) - 安全机制:TOCTOU 防护、路径遍历防护、扩展名白名单、1MiB 大小限制、缓存防污染 - 21/21 对比测试全部通过,性能 3x(0.33ms vs 1.01ms),RSS -66% - confs/confs.py + log_client.py: 时间戳从 timezone.utc 改为系统时区 - confs2/src/main.cpp + LogC.hpp: 同步改为系统时区(localtime + %z) - core/init.txt: confs/_run.sh → confs2/_run.sh
This commit is contained in:
1 parent
c13d11aafb
commit
1b282c6f1a
10 files changed
+917
-7
No files matched your search
+3
-3
@@ -22,7 +22,7 @@ import json
|
||||
import os as _os
|
||||
import sys as _sys
|
||||
import atexit
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
|
||||
_sys.path.insert(0, _os.path.join(_os.path.dirname(__file__), ".."))
|
||||
from pymsg import RpcClient, RpcError, AsyncRpcQueue # noqa: E402
|
||||
@@ -47,8 +47,8 @@ def _safe_json(obj):
|
||||
|
||||
|
||||
def _now_iso():
|
||||
"""生成当前 UTC 时间 ISO 字符串(入队时调用,保证时间戳准确)。"""
|
||||
return datetime.now(timezone.utc).isoformat()
|
||||
"""生成当前系统时间 ISO 字符串(入队时调用,保证时间戳准确)。"""
|
||||
return datetime.now().astimezone().isoformat()
|
||||
|
||||
|
||||
class LogClient:
|
||||
|
||||
Reference in new issue
Block a user