Queue wait is visible: 'Queued… · Ns' + created_at on job payloads

This commit is contained in:
avi 2026-09-16 16:15:32 -05:00
commit 3e1ec8eff8
4 changed files with 30 additions and 2 deletions

View file

@ -59,6 +59,9 @@ data class JobInfo(
val progress: Int? = null,
/** ISO-8601 UTC when the job started running (null if unknown). */
val startedAt: String? = null,
/** ISO-8601 UTC when the job was queued (null if unknown). The wait
* label counts from this while the engine holds the job queued. */
val createdAt: String? = null,
)
/** Summary content keys, in display order. */
@ -135,6 +138,7 @@ fun parseJobs(raw: String): List<JobInfo> = runCatching {
stage = o.optString("stage", null).takeUnless { it.isNullOrBlank() },
progress = if (o.has("progress") && !o.isNull("progress")) o.optInt("progress") else null,
startedAt = o.optString("started_at", null).takeUnless { it.isNullOrBlank() },
createdAt = o.optString("created_at", null).takeUnless { it.isNullOrBlank() },
)
}
}.getOrDefault(emptyList())