feat: 综合平台services多服务支持+SW网络优先缓存修复+适配层/定时任务完善

This commit is contained in:
gouki
2026-08-05 11:57:17 +00:00
parent 7f1268f508
commit 1b7d4823c3
47 changed files with 2895 additions and 1189 deletions
+3 -1
View File
@@ -4,6 +4,7 @@
MASTER_KEY 从 .env 读取,不入库。
"""
from functools import lru_cache
from typing import Optional
from cryptography.fernet import Fernet, InvalidToken
@@ -11,8 +12,9 @@ from cryptography.fernet import Fernet, InvalidToken
from app.core.config import settings
@lru_cache(maxsize=1)
def _get_fernet() -> Fernet:
"""获取 Fernet 实例(MASTER_KEY 未配置时抛错)"""
"""获取 Fernet 实例(进程内缓存,避免每次加解密重建;MASTER_KEY 未配置时抛错)"""
key = settings.MASTER_KEY
if not key:
raise RuntimeError(