aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-05 16:11:52 +0100
committerChristopher Baines <mail@cbaines.net>2019-12-12 20:07:22 +0000
commiteb2ba599d94d28fe421a262a2ffbf7528d367aa4 (patch)
tree9a8abbe0c1f1a20175b028e8e062b9dc30e96bf9
parent0291bda98abf4cf4299434ed304aa72846f405dd (diff)
downloaddata-service-eb2ba599d94d28fe421a262a2ffbf7528d367aa4.tar
data-service-eb2ba599d94d28fe421a262a2ffbf7528d367aa4.tar.gz
Populate the narinfo_fetch_records table
-rw-r--r--guix-data-service/builds.scm1
-rw-r--r--guix-data-service/model/nar.scm13
2 files changed, 12 insertions, 2 deletions
diff --git a/guix-data-service/builds.scm b/guix-data-service/builds.scm
index 370eee2..53d751f 100644
--- a/guix-data-service/builds.scm
+++ b/guix-data-service/builds.scm
@@ -232,4 +232,5 @@ LIMIT 15000"))
(lambda (conn)
(record-narinfo-details-and-return-ids
conn
+ build-server-id
narinfos))))))
diff --git a/guix-data-service/model/nar.scm b/guix-data-service/model/nar.scm
index 92c4d11..d3a524e 100644
--- a/guix-data-service/model/nar.scm
+++ b/guix-data-service/model/nar.scm
@@ -18,7 +18,7 @@
(define narinfo-contents
(@@ (guix scripts substitute) narinfo-contents))
-(define (record-narinfo-details-and-return-ids conn narinfos)
+(define (record-narinfo-details-and-return-ids conn build-server-id narinfos)
(define data
(map (lambda (narinfo)
(match (string-split
@@ -106,7 +106,16 @@ VALUES "
nar-id
narinfo-signature-data-id)
"
-ON CONFLICT DO NOTHING"))))
+ON CONFLICT DO NOTHING"))
+
+ (exec-query
+ conn
+ (string-append
+ "
+INSERT INTO narinfo_fetch_records (narinfo_signature_data_id, build_server_id)
+VALUES ($1, $2)")
+ (list (number->string narinfo-signature-data-id)
+ (number->string build-server-id)))))
nar-ids
narinfos)