feat: home growth auto(7→1) + hourly recent-video snapshot #2

Merged
kairee merged 2 commits from auto/growth-recent-snapshot-1a44 into main 2026-11-02 10:25:36 +08:00

Summary

  • 首页增长动态:analytics.home_growth_days(auto|1|7,默认 auto)。growth_days=auto 先试 7 天,不可用再降到 1 天;区块标题显示当前窗口,「增长榜」链接带上对应 growth_days;空态文案按窗口天数说明。
  • 新视频小时同步:独立调度任务 snapshot_recent(schedule.recent_snapshot_minutes 默认 60,recent_video_days 默认 2,按 pubdate 墙钟窗口)。run_recent_videos 只 upsert 当日行,不改 snapshot:completed / last_completed / 日备份。与全站 snapshot 互斥。
  • 00:01 全站快照:继续跳过同日 ok=1 行(覆盖小时任务 1 小时内刚刷新的场景);完成日与备份仍由全量任务负责。
  • 系统页增加「新视频小时同步」下次运行 / 运行中。

Test plan

  • uv run python tests/test_config.py(含 home_growth_days / recent_* 校验)
  • uv run python tests/test_snapshot.py(recent 不写完成日;全量跳过 ok=1)
  • uv run python tests/test_web_queries.py(auto 7→1、next_runs)
  • 全量 tests/test_*.py 34 个文件离线通过
## Summary - **首页增长动态**:`analytics.home_growth_days`(`auto`|`1`|`7`,默认 `auto`)。`growth_days=auto` 先试 7 天,不可用再降到 1 天;区块标题显示当前窗口,「增长榜」链接带上对应 `growth_days`;空态文案按窗口天数说明。 - **新视频小时同步**:独立调度任务 `snapshot_recent`(`schedule.recent_snapshot_minutes` 默认 60,`recent_video_days` 默认 2,按 pubdate 墙钟窗口)。`run_recent_videos` 只 upsert 当日行,**不**改 `snapshot:completed` / `last_completed` / 日备份。与全站 `snapshot` 互斥。 - **00:01 全站快照**:继续跳过同日 `ok=1` 行(覆盖小时任务 1 小时内刚刷新的场景);完成日与备份仍由全量任务负责。 - 系统页增加「新视频小时同步」下次运行 / 运行中。 ## Test plan - [x] `uv run python tests/test_config.py`(含 home_growth_days / recent_* 校验) - [x] `uv run python tests/test_snapshot.py`(recent 不写完成日;全量跳过 ok=1) - [x] `uv run python tests/test_web_queries.py`(auto 7→1、next_runs) - [x] 全量 `tests/test_*.py` 34 个文件离线通过
bot-ci Bot added 1 commit 2026-11-02 10:00:20 +08:00
- Add analytics.home_growth_days (auto|1|7); API growth_days=auto tries 7 then 1
- Homepage shows active window and growth-board link; clearer empty reason
- New snapshot_recent scheduler task (schedule.recent_snapshot_minutes/days)
- run_recent_videos refreshes new aids only; never touches completed/backup
- Full 00:01 job keeps ok=1 skip (covers hourly refresh within 1h); mutex with recent
bot-ci Bot added 1 commit 2026-11-02 10:05:04 +08:00
Home omits growth_days; backend auto (or home_growth_days 1/7) picks
the window. Response includes days alongside growth_days. Growth榜 link
uses the returned days. Non-growth sorts treat omitted/auto as 7.
kairee merged commit 12732f6316 into main 2026-11-02 10:25:36 +08:00
kairee deleted branch auto/growth-recent-snapshot-1a44 2026-11-02 10:25:37 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kcloud/re-xxm#2