diff options
author | Christopher Baines <mail@cbaines.net> | 2019-12-31 14:58:31 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-12-31 14:58:31 +0000 |
commit | a6302a32ef28004b3988188a60e10cdc216eb67c (patch) | |
tree | 22fb27443d31b81c6e7ca8b64fd389545adc285e | |
parent | f2343b5fc9228b08be87a2a3a87cc6eda75d674c (diff) | |
download | data-service-a6302a32ef28004b3988188a60e10cdc216eb67c.tar data-service-a6302a32ef28004b3988188a60e10cdc216eb67c.tar.gz |
Make it possible to specify the batch size
In backfill-derivation-source-file-nars.
-rw-r--r-- | guix-data-service/model/derivation.scm | 5 |
1 files 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) |