2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00

Fix build duration display.

* src/cuirass/templates.scm (build-details): Fix build duration display.
This commit is contained in:
Mathieu Othacehe 2021-01-30 16:11:50 +01:00
parent 154653b4c8
commit 158dd2bd42
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -291,11 +291,17 @@ system whose names start with " (code "guile-") ":" (br)
(tr (th "Name")
(td ,(assq-ref build #:nix-name)))
(tr (th "Duration")
(td ,(or (and-let* ((start (assq-ref build #:starttime))
(stop (assq-ref build #:stoptime)))
(string-append (number->string (- stop start))
" seconds"))
"—")))
(td ,(let ((timestamp (time-second (current-time time-utc)))
(start (assq-ref build #:starttime))
(stop (assq-ref build #:stoptime)))
(cond
((and (> start 0) (> stop 0))
(string-append (number->string (- stop start))
" seconds"))
((> start 0)
(string-append (number->string (- timestamp start))
" seconds"))
(else "—")))))
(tr (th "Finished")
(td ,(if completed?
(time->string (assq-ref build #:stoptime))