fix(system): three next-runs, completed-date data_date, running mark

Split /system schedule into fans / snapshot+UP / discovery next-runs.
Drive data_date and snapshot_days from fully completed video snapshots
only, keep prior success date on failure, show task failure records, and
mark in-progress tasks as 运行中 without wall-clock next-run jumps.
This commit is contained in:
bot-ci committed 2026-11-02 00:46:20 +08:00
1 parent 0b92e10317
commit af90ce8f87
9 files changed
+411 -52

No files matched your search

+18
View File
@@ -278,6 +278,13 @@ def _seed_task_records(
"error": None,
"summary": {"refs": 2, "added": 2, "ok": True},
},
"fans": {
"name": "fans", "ok": True,
"started_at": int(base + 1124),
"finished_at": int(base + 1130),
"error": None,
"summary": {"fans_ok": 1, "fans_failed": 0, "fans_skipped": 0},
},
"discovery": {
"name": "discovery", "ok": True,
"started_at": int(base + 21 * 3600),
@@ -309,6 +316,17 @@ def _seed_task_records(
"INSERT OR REPLACE INTO kv(k, v) VALUES ('snapshot:last_completed', ?)",
(latest_day.isoformat(),),
)
conn.execute(
"INSERT OR REPLACE INTO kv(k, v) VALUES (?, '1')",
(f"snapshot:completed:{latest_day.isoformat()}",),
)
for (day,) in conn.execute(
"SELECT DISTINCT stat_date FROM snapshot WHERE ok = 1"
).fetchall():
conn.execute(
"INSERT OR REPLACE INTO kv(k, v) VALUES (?, '1')",
(f"snapshot:completed:{day}",),
)
conn.execute(
"INSERT OR REPLACE INTO kv(k, v) VALUES (?, '1')",
(f"snapshot:backup:{latest_day.isoformat()}",),