diff options
author | Christopher Baines <mail@cbaines.net> | 2021-11-21 21:59:16 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-11-21 21:59:16 +0000 |
commit | 8690d84931d7f24362148285e3a9101b1569f21d (patch) | |
tree | 94842b67a647b942be8599ac3dda28e3fa53a559 /guix-build-coordinator/agent-messaging/http.scm | |
parent | c1089f9ceef8e84e13952ea5a4b71decbbd670a5 (diff) | |
download | build-coordinator-8690d84931d7f24362148285e3a9101b1569f21d.tar build-coordinator-8690d84931d7f24362148285e3a9101b1569f21d.tar.gz |
Only check the size of the file once when uploading
Diffstat (limited to 'guix-build-coordinator/agent-messaging/http.scm')
-rw-r--r-- | guix-build-coordinator/agent-messaging/http.scm | 5 |
1 files changed, 4 insertions, 1 deletions
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 |