aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-04-27 19:26:31 +0100
committerChristopher Baines <mail@cbaines.net>2024-04-27 19:26:31 +0100
commitff68badd0782db46f7911886374e343abcb445b1 (patch)
tree5aea5919de597bbb1e51f96cdbb095f55019dbbc
parentc539ffd89c24a8346253d1cf9769ef991ffebd24 (diff)
downloadnar-herder-ff68badd0782db46f7911886374e343abcb445b1.tar
nar-herder-ff68badd0782db46f7911886374e343abcb445b1.tar.gz
Guard against trying to fetch things twice
-rw-r--r--nar-herder/storage.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index f5047b5..df8ec4d 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -747,7 +747,10 @@ When VERIFY-CERTIFICATE? is true, verify HTTPS server certificates."
(lambda (exn)
(log-msg 'ERROR "failed to mirror " file ": " exn))
(lambda ()
- (fetch-file file))
+ (unless (file-exists?
+ (string-append storage-root
+ (uri-decode file)))
+ (fetch-file file)))
#:unwind? #t))))))
(spawn-fiber