repo: add duration_s to get_group_run query
The group run detail page was crashing because get_group_run returned no
duration_s field, unlike the list queries. Fixes 500 on /group-runs/{id}.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ed3653f410
commit
c8b507cdc3
@ -662,7 +662,10 @@ def create_group_run(group_id: int, *, triggered_by: str | None = None) -> int:
|
||||
def get_group_run(group_run_id: int) -> dict | None:
|
||||
with db.connect() as c:
|
||||
return _row(c.execute(
|
||||
"SELECT gr.*, g.name AS group_name "
|
||||
"SELECT gr.*, g.name AS group_name, "
|
||||
"CASE WHEN gr.started_at IS NOT NULL AND gr.finished_at IS NOT NULL "
|
||||
"THEN CAST(ROUND((julianday(gr.finished_at) - julianday(gr.started_at)) * 86400) AS INTEGER) "
|
||||
"ELSE NULL END AS duration_s "
|
||||
"FROM group_run gr "
|
||||
"JOIN grp g ON gr.group_id=g.id "
|
||||
"WHERE gr.id=?",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user