cbaines pushed a commit to branch master
in repository data-service.
commit 97b76000ec2eeb7905a7cc1de4e81e91b966e918
Author: Christopher Baines <[email protected]>
AuthorDate: Fri Aug 9 15:47:49 2024 +0100
Check the WAL size for each chunk
Rather than for each system and target, as this should mean the
response (pausing and allowing inferiors and store connections to be closed)
is quicker.
---
guix-data-service/jobs/load-new-guix-revision.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm
b/guix-data-service/jobs/load-new-guix-revision.scm
index 2d6af34..5e28ba0 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -1891,7 +1891,7 @@ SELECT 1 FROM derivation_source_file_nars WHERE
derivation_source_file_id = $1"
(define chunk-size 5000)
- (define (process-system-and-target system target)
+ (define (check-wal-size)
(let loop ((wal-bytes
(catch #t
(lambda ()
@@ -1914,6 +1914,7 @@ SELECT 1 FROM derivation_source_file_nars WHERE
derivation_source_file_id = $1"
(with-time-logging
(simple-format #f "getting derivations for ~A" (cons system
target))
(let loop ((start-index 0))
+ (check-wal-size)
(let* ((count
(if (>= (+ start-index chunk-size) packages-count)
(- packages-count start-index)