aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/agent.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-12-19 21:49:31 +0000
committerChristopher Baines <mail@cbaines.net>2021-12-19 21:49:31 +0000
commit7ac70a06c8c61562eaae5118613018997c09a4c5 (patch)
tree75d8c91d22a3f60d8cca60630300149e834934fd /guix-build-coordinator/agent.scm
parente1208255f455e72ac983be94f3c0473486ab9577 (diff)
downloadbuild-coordinator-7ac70a06c8c61562eaae5118613018997c09a4c5.tar
build-coordinator-7ac70a06c8c61562eaae5118613018997c09a4c5.tar.gz
Fix displaying the total bytes for uploads in progress
Diffstat (limited to 'guix-build-coordinator/agent.scm')
-rw-r--r--guix-build-coordinator/agent.scm10
1 files changed, 6 insertions, 4 deletions
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 <upload-progress>
- (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)))))