From eb2ba599d94d28fe421a262a2ffbf7528d367aa4 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 5 Dec 2019 16:11:52 +0100 Subject: Populate the narinfo_fetch_records table --- guix-data-service/builds.scm | 1 + guix-data-service/model/nar.scm | 13 +++++++++++-- 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) -- cgit v1.2.3