From 42463556bf4eaa20eaadd574102597a130206196 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 17 May 2023 13:27:48 +0100 Subject: Guard against the stat call failing If the file doesn't exist. --- .../agent-messaging/http/server.scm | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'guix-build-coordinator/agent-messaging') 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 () -- cgit v1.2.3