Add a #:loop? option to backfill-derivation-source-file-nars

This commit is contained in:
Christopher Baines 2020-01-03 21:42:52 +00:00
parent 4ed14007c4
commit d107830300

View file

@ -1066,7 +1066,9 @@ INSERT INTO derivation_source_file_nars (
(number->string uncompressed-size) (number->string uncompressed-size)
(string-append "\\x" data-string)))))) (string-append "\\x" data-string))))))
(define* (backfill-derivation-source-file-nars conn #:key (batch-size 10000)) (define* (backfill-derivation-source-file-nars conn #:key
(batch-size 10000)
(loop? #t))
(define (missing-batch) (define (missing-batch)
(exec-query (exec-query
conn conn
@ -1092,7 +1094,7 @@ LIMIT $1"
(simple-format #t "inserting ~A\n" source-file)) (simple-format #t "inserting ~A\n" source-file))
(simple-format #t "missing ~A\n" source-file)))) (simple-format #t "missing ~A\n" source-file))))
batch) batch)
(loop (missing-batch))))) (when loop? (loop (missing-batch))))))
(define (insert-missing-derivations conn (define (insert-missing-derivations conn
derivation-ids-hash-table derivation-ids-hash-table