Show collect start/end times on biz-state task and batch lists.

Helps tune schedule interval from last-run window and batch duration.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-22 15:58:32 +08:00
parent 12b60c2a52
commit c15ea00a23
4 changed files with 48 additions and 4 deletions

View file

@ -428,6 +428,9 @@ def list_tasks(db: Session, *, purpose: str | None = None) -> list[dict[str, Any
"interval_sec": t.interval_sec,
"collect_running": bool(t.collect_running),
"last_error": t.last_error,
"last_collect_started_at": t.last_collect_started_at.isoformat() + "Z"
if t.last_collect_started_at
else None,
"last_collect_ended_at": t.last_collect_ended_at.isoformat() + "Z"
if t.last_collect_ended_at
else None,