Files
MoFin/archive/hermes-dead-tools-20260820/notify_user4.py
T
xxm c68f987653 chore(cleansweep): 代码大扫除——归档hermes 111个死工具+4个废弃scanner,收敛MoFin/scripts重复副本,删除根旧版mo_models
- archive/hermes-dead-tools-20260820/: hermes独有不在cron不被import的111个一次性排查/测试工具
- archive/hermes-dead-tools-20260820/: 4个废弃scanner(btd1_v3/market_scanner/market_thermometer已废弃/s2v2)
- archive/legacy-cleanup-20260820/: MoFin根2旧版(mo_models/technical_analysis)+/home/hmo/scripts无引用旧项目+MoFin/scripts重复prepare_report_data
- 删除MoFin根mo_models.py(根旧版,deploy/profile-scripts权威保留)
- 保留: mofin_db.py/mo_data.py硬链接(server.py多层sys.path需各目录访问同一inode,非冗余)
- fix_gateway.py保留(Gateway看门狗fix_gateway_port.py的活跃依赖,勿误删)
- 验证: cron所有脚本引用无缺失, key模块import正常
- hermes独有从116收敛到5核心(alert_logger/market_screener/prepare_report_data/self_todo_executor_v2/xmpp_zhiwei_bot)
2026-08-20 10:36:25 +08:00

32 lines
1.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import json, urllib.request
msg = """[笑笑] price_events.json 已彻底退役 — 全系统只认 DB
按你的指示,所有和 price_events.json 相关的代码已全部改完:
【代码修改(6个文件)】
1. price_monitor.py — record_event 只写 DBEVENTS_PATH/load_events/save_events 全部删除
2. strategy_feedback.py — 价格事件只从 DB 读,JSON fallback 删除
3. system_health_check.py — 文件检查清单移除 price_events.json,事件统计只读 DB
4. mo_config.py — 删除无调用的 price_events_path 死属性
5. mofin_health.py — 新鲜度检查改回读 DB 表(现在它是权威了)
6. mofin_db.py — 修了一个更大的坑 ⬇️
【顺藤摸出的更大的坑:三个数据库】
mofin_db.py 的 DB_PATH 原来是相对路径(__file__.parent/data),导致每个硬链接副本解析到不同的库:主库、web-dashboard 库、还有 profile 本地一个几乎全空的第三库。健康检查之前读到 0 条事件就是因为读到了那个空库。已改为绝对路径 /home/hmo/MoFin/data4 份 mofin_db 副本已统一硬链接。
【验证结果】
✅ record_event 只写 DBJSON 不再被重建
✅ system_health_check:历史事件 6353 条 / 今日事件 2965 条(之前误报 0/0)
✅ strategy_feedback / price_monitor 完整跑通
✅ price_events.json 已归档 trashbox(数据早已全量回填 DB
JSON 时代结束。"""
payload = json.dumps({"to": "hmo@yoin.fun", "body": msg, "type": "chat"}).encode()
req = urllib.request.Request("http://127.0.0.1:5805/", data=payload,
headers={"Content-Type": "application/json"})
try:
print("XMPP:", urllib.request.urlopen(req, timeout=10).read().decode()[:80])
except Exception as e:
print("XMPP fail:", e)