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
+20
View File
@@ -39,5 +39,25 @@ class Settings:
# ---- 续费提醒 ----
RENEWAL_THRESHOLD_DAYS: int = int(os.getenv("RENEWAL_THRESHOLD_DAYS", "30"))
# ---- 监控数据保留策略(自动清理)----
# MetricPoint 时序数据保留天数(Agent 高频上报,默认 30 天)
METRICS_RETENTION_DAYS: int = int(os.getenv("METRICS_RETENTION_DAYS", "30"))
# SecurityCheck 安全检查历史保留天数(默认 90 天)
SECURITY_RETENTION_DAYS: int = int(os.getenv("SECURITY_RETENTION_DAYS", "90"))
# EventLog 事件日志保留天数(默认 180 天)
EVENT_LOG_RETENTION_DAYS: int = int(os.getenv("EVENT_LOG_RETENTION_DAYS", "180"))
# 自动清理间隔(小时),0 表示禁用后台自动清理
CLEANUP_INTERVAL_HOURS: int = int(os.getenv("CLEANUP_INTERVAL_HOURS", "24"))
# ---- Agent 上报频率限制 ----
# 同一 asset_id 两次上报的最小间隔(秒),0 表示不限制
AGENT_REPORT_MIN_INTERVAL: int = int(os.getenv("AGENT_REPORT_MIN_INTERVAL", "30"))
# ---- CORS 允许来源(逗号分隔),默认本地 + Tailscale ----
CORS_ORIGINS: str = os.getenv(
"CORS_ORIGINS",
"http://127.0.0.1:8000,http://localhost:8000,https://dify.taile5765c.ts.net",
)
settings = Settings()