Sort builds by start datetime

This commit is contained in:
Reynir Björnsson 2020-12-07 21:45:15 +01:00
parent 60a3f629d8
commit 6e2c5718c1

View file

@ -31,7 +31,10 @@ let routes (t : Model.t) =
Model.job t job with
| Ok job ->
let name = Model.job_name job
and runs = job.Model.runs in
and runs = List.sort
(fun (b1 : Model.job_run_meta) (b2 : Model.job_run_meta) ->
Ptime.compare b1.start b2.start)
job.Model.runs in
Views.job name runs |> Response.of_html |> Lwt.return
| Error (`Msg e) ->
Log.warn (fun m -> m "Error getting job: %s" e);