From 7ac70a06c8c61562eaae5118613018997c09a4c5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 19 Dec 2021 21:49:31 +0000 Subject: Fix displaying the total bytes for uploads in progress --- guix-build-coordinator/agent.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'guix-build-coordinator/agent.scm') diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index f8a95fa..eabb917 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -49,10 +49,11 @@ #:export (run-agent)) (define-record-type - (make-upload-progress file bytes-sent) + (make-upload-progress file bytes-sent total-bytes) upload-progress? (file upload-progress-file) - (bytes-sent upload-progress-bytes-sent set-upload-progress-bytes-sent!)) + (bytes-sent upload-progress-bytes-sent set-upload-progress-bytes-sent!) + (total-bytes upload-progress-total-bytes)) (define temporary-directory (or (getenv "TMPDIR") "/tmp")) @@ -121,7 +122,7 @@ (define (with-upload-monitoring lgr file total-bytes p) (define upload-progress-record - (make-upload-progress file 0)) + (make-upload-progress file 0 total-bytes)) (define last-progress-update-bytes-sent 0) (define last-progress-update-time 0) @@ -162,7 +163,8 @@ (/ (upload-progress-bytes-sent upload-progress) 1000000) - (/ total-bytes 1000000)) + (/ (upload-progress-total-bytes upload-progress) + 1000000)) "MB sent"))) upload-slots))))) -- cgit v1.2.3