aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-05-17 13:27:48 +0100
committerChristopher Baines <mail@cbaines.net>2023-05-17 13:27:48 +0100
commit42463556bf4eaa20eaadd574102597a130206196 (patch)
tree76d73434028fa41a109d8656c160826339bff66e
parentc66399ee4d10e6d9f7d086ffd1615c6de60320e7 (diff)
downloadbuild-coordinator-42463556bf4eaa20eaadd574102597a130206196.tar
build-coordinator-42463556bf4eaa20eaadd574102597a130206196.tar.gz
Guard against the stat call failing
If the file doesn't exist.
-rw-r--r--guix-build-coordinator/agent-messaging/http/server.scm24
1 files changed, 13 insertions, 11 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm
index 222c6f5..806c201 100644
--- a/guix-build-coordinator/agent-messaging/http/server.scm
+++ b/guix-build-coordinator/agent-messaging/http/server.scm
@@ -414,18 +414,20 @@ port. Also, the port used can be changed by passing the --port option.\n"
(begin
(log-msg/safe logger 'DEBUG build-uuid
": starting thread to compute hash for " filename)
+ (let ((size
+ ;; This call could fail
+ (stat:size (stat filename))))
+ (hash-set! hash-progress-by-filename
+ filename
+ (make-hash-progress
+ build-uuid
+ filename
+ size
+ 0))
- (hash-set! update-channels-by-filename
- filename
- (list update-channel))
-
- (hash-set! hash-progress-by-filename
- filename
- (make-hash-progress
- build-uuid
- filename
- (stat:size (stat filename))
- 0))
+ (hash-set! update-channels-by-filename
+ filename
+ (list update-channel)))
(call-with-new-thread
(lambda ()