Commit Graph

3 Commits

Author SHA1 Message Date
gao d140fee9e7 fix: 早盘前 09:00 stock_basic + industry_sector 没触发
work #02 (2026-07-03):daily_check 复跑仍 10 missed,细看时间窗口发现
新问题——09:00 / 09:30 该跑的 2 个早盘前 task today 没触发。

根因:worker.py 进程内 scheduler 是预期的主调度(含 09:00 / 09:30),
但 worker.py 没人拉起;systemd timers 又只覆盖 15:30 / 21:xx,缺早盘档。
昨 18h 删 monitor 同时没补 worker.py → 早盘缺口暴露。

变更:
- bin/market_sync_morning_run.sh: 轻量 morning wrapper,只跑 stock_basic
  + industry_sector 串行(~25min),不复用 runall_once.py 的 8 task
- bin/systemd/market-sync-morning.{service,timer}: Mon..Fri 09:00 daily
  触发,TimeoutStartSec=3600 (1h)
- docs/works/2026-07-03-02-morning-no-trigger.md: 完整 work 记录

不在本 work 范围(更大重构):把 worker.py 拉起作为 long-running,
与 systemd timer 收敛到单一调度器——见 dual-scheduler-overlap memory。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-03 10:50:25 +08:00
gao 295177027f fix: market-sync 2h timeout 截断 + 加 daily-check 巡检
work #01 (2026-07-03):昨天 15:30 runall 中 kline_5min 全量 69min 把 2h
窗口吃满,share_snapshot / market_regime 被 systemd SIGTERM 截断;
今天又叠加 worker.py 未长驻,导致 10 个 task missed。

变更:
- bin/systemd/market-sync.service: TimeoutStartSec 7200 → 14400 (4h)
- bin/daily_sync_check.py: 新增每日巡检,读 PG dataset_registry,
  对比 SCHEDULE 判定 ok/missed/failed/stuck/never_run,写 JSON 报告,
  失败时 POST HMAC webhook
- bin/systemd/market-sync-daily-check.{service,timer}: 23:00 daily 触发
  daily_check(替代 session-only 的 /loop 方案)
- config/daily_check_secrets.env.template: webhook 配置模板
- docs/works/2026-07-03-01-market-sync-timeout.md: 完整 work 记录
  (根因 + 中期/长期改进建议)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-03 10:48:20 +08:00
gao 05635b76b9 chore: 重构前基线 — 9 个 sync task 全部 ok + akshare 移除 + mairui 资金流接入
状态:
- 9 个 sync task(stock_basic / kline_daily / kline_index / kline_5min /
  moneyflow / industry_sector / sector_features / share_snapshot / market_regime)
- 数据源:baostock + mairui + 雪球(pysnowball) + 新浪(4 个)
- 项目级约束:永远不用 akshare(已落实)
- kline_5min 改用 DB 快照统一全量/增量逻辑
- 零后端 Chrome 扩展 xueqiu_sync(独立项目)
2026-06-15 15:36:09 +08:00