From 35275d44086a1b0d78dc3b177da0448c4bfd35a4 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 15 Jun 2024 19:53:20 +0100 Subject: Insert the narinfo record before moving the nar So that if inserting the narinfo record fails, the nars won't be moved. --- scripts/nar-herder.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 49a634c..7326526 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -417,6 +417,12 @@ (read-narinfo port "https://narherderdummyvalue"))))) + (database-insert-narinfo + database + narinfo + #:tags (or (assq-ref opts 'tags) + '())) + (when canonical-storage (for-each (lambda (uri) @@ -436,12 +442,6 @@ (rename-file source dest)))) (narinfo-uris narinfo))) - (database-insert-narinfo - database - narinfo - #:tags (or (assq-ref opts 'tags) - '())) - (report) narinfo)) -- cgit v1.2.3