feat: home growth auto(7→1) and hourly recent-video snapshot
- 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
This commit is contained in:
1 parent
04716aec1b
commit
9163f47b76
15 files changed
+496
-22
No files matched your search
@@ -637,6 +637,19 @@ class Repository:
|
||||
return [int(row["aid"]) for row in rows]
|
||||
return self.db.read(run)
|
||||
|
||||
def video_aids_recent_for_snapshot(self, *, since_pubdate: int) -> list[int]:
|
||||
"""近 N 天新视频:按 pubdate 墙钟窗口(since_pubdate = now - days*86400)。"""
|
||||
def run(conn: sqlite3.Connection) -> list[int]:
|
||||
rows = conn.execute(
|
||||
"SELECT aid FROM video "
|
||||
"WHERE status IN ('active', 'unfaved') "
|
||||
"AND pubdate IS NOT NULL AND pubdate >= ? "
|
||||
"ORDER BY aid",
|
||||
(int(since_pubdate),),
|
||||
).fetchall()
|
||||
return [int(row["aid"]) for row in rows]
|
||||
return self.db.read(run)
|
||||
|
||||
def pending_snapshot_aids(self, stat_date: str) -> list[int]:
|
||||
"""当天仍缺成功快照的追踪视频;用于新入库/恢复后的同日补采。"""
|
||||
def run(conn: sqlite3.Connection) -> list[int]:
|
||||
|
||||
Reference in new issue
Block a user