From a6302a32ef28004b3988188a60e10cdc216eb67c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 31 Dec 2019 14:58:31 +0000 Subject: Make it possible to specify the batch size In backfill-derivation-source-file-nars. --- guix-data-service/model/derivation.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm index 8a9e88c..29a1ce7 100644 --- a/guix-data-service/model/derivation.scm +++ b/guix-data-service/model/derivation.scm @@ -1066,7 +1066,7 @@ INSERT INTO derivation_source_file_nars ( (number->string uncompressed-size) (string-append "\\x" data-string)))))) -(define (backfill-derivation-source-file-nars conn) +(define* (backfill-derivation-source-file-nars conn #:key (batch-size 10000)) (define (missing-batch) (exec-query conn @@ -1076,7 +1076,8 @@ FROM derivation_source_files WHERE id NOT IN ( SELECT derivation_source_file_id FROM derivation_source_file_nars ) -LIMIT 1000")) +LIMIT $1" + (list (number->string batch-size)))) (let loop ((batch (missing-batch))) (unless (null? batch) -- cgit v1.2.3