From 8690d84931d7f24362148285e3a9101b1569f21d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 21 Nov 2021 21:59:16 +0000 Subject: Only check the size of the file once when uploading --- guix-build-coordinator/agent-messaging/http.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'guix-build-coordinator/agent-messaging/http.scm') diff --git a/guix-build-coordinator/agent-messaging/http.scm b/guix-build-coordinator/agent-messaging/http.scm index e3c2a4c..8b2f04c 100644 --- a/guix-build-coordinator/agent-messaging/http.scm +++ b/guix-build-coordinator/agent-messaging/http.scm @@ -253,6 +253,9 @@ #:key (log default-log) report-bytes-sent) + (define file-size + (stat:size (stat file))) + (define (get-partial-upload-bytes) (let-values (((body response) (coordinator-http-request @@ -302,7 +305,7 @@ (get-completed-upload-bytes)))) ;; Check if the server has all the bytes (unless (and bytes - (eq? bytes (stat:size (stat file)))) + (eq? bytes file-size)) ;; Still more to send (call-with-input-file file -- cgit v1.2.3