feat: BTC 时K 默认范围由 72 小时改为 48 小时

- BTC_LIMIT 默认 72→48(.env 未覆盖时即生效),文档同步
- BTC 文件缓存判定加入根数校验:改周期或根数后 TTL 内不再沿用旧范围
- CLAUDE.md 补充 cloudflared 快速隧道运维经验:隧道会被静默回收,
  重启用 --protocol http2 并剥掉代理环境变量

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-14 10:37:18 +08:00
parent b1a99a0e6b
commit b58e1decf0
6 changed files with 14 additions and 9 deletions

View File

@@ -97,10 +97,10 @@ WEATHER_CACHE_PATH = os.path.join(BASE_DIR, ".weather_cache.json")
TREND_CACHE_PATH = os.path.join(BASE_DIR, ".trend_cache.json")
# ---- 比特币 K 线(仅 800x480 宽版底部面板)----
# 免费公开接口无需密钥逐源兜底OKX → Coinbase → Huobi见 btc_api.py。当前为时 K、近 72 小时(3 天);
# 免费公开接口无需密钥逐源兜底OKX → Coinbase → Huobi见 btc_api.py。当前为时 K、近 48 小时(2 天);
# 每 5 分钟刷新(与 launchd 节律一致,最新一根随实时价推进)。拉取失败沿用旧缓存。缓存文件已在 .gitignore。
BTC_BAR = os.environ.get("BTC_BAR", "1H") # 周期:"1H" 时K / "1D" 日K
BTC_LIMIT = int(os.environ.get("BTC_LIMIT", "72")) # 展示最近 N 根(时 K 默认 72 = 近 3 天)
BTC_LIMIT = int(os.environ.get("BTC_LIMIT", "48")) # 展示最近 N 根(时 K 默认 48 = 近 22026-09-14 由 72 改 48
BTC_TTL = int(os.environ.get("BTC_TTL", "300")) # 秒,默认 5 分钟(本机文件缓存与 server.py 内存缓存共用)
BTC_CACHE_PATH = os.path.join(BASE_DIR, ".btc_cache.json")