aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-08-20 09:49:41 +0100
committerChristopher Baines <mail@cbaines.net>2024-08-20 09:49:41 +0100
commitf6eadb0b1678b3437ed21862955f52dde7bd0982 (patch)
tree89f30f6fad457972607cd76f926b0d5f9aaa0f70
parent6de908d0f4913e1ff0427045f154aeda1e72f07f (diff)
downloaddata-service-f6eadb0b1678b3437ed21862955f52dde7bd0982.tar
data-service-f6eadb0b1678b3437ed21862955f52dde7bd0982.tar.gz
Make the free space requirement configurable
-rw-r--r--guix-data-service/jobs.scm6
-rw-r--r--scripts/guix-data-service-process-jobs.in13
2 files changed, 14 insertions, 5 deletions
diff --git a/guix-data-service/jobs.scm b/guix-data-service/jobs.scm
index 71d22ef..eb9bfa8 100644
--- a/guix-data-service/jobs.scm
+++ b/guix-data-service/jobs.scm
@@ -128,10 +128,12 @@ guix-data-service: error: missing log line: ~A
latest-branch-revision-max-processes
skip-system-tests?
extra-inferior-environment-variables
- per-job-parallelism)
+ per-job-parallelism
+ (free-space-requirement
+ (* 2 (expt 2 30)))) ; 2G
(define (fetch-new-jobs)
(let ((free-space (free-disk-space "/gnu/store")))
- (if (< free-space (* 2 (expt 2 30))) ; 2G
+ (if (< free-space free-space-requirement)
(begin
(simple-format
(current-error-port)
diff --git a/scripts/guix-data-service-process-jobs.in b/scripts/guix-data-service-process-jobs.in
index cbe92f2..0f7af73 100644
--- a/scripts/guix-data-service-process-jobs.in
+++ b/scripts/guix-data-service-process-jobs.in
@@ -55,6 +55,11 @@
(lambda (opt name arg result)
(alist-cons 'inferior-environment-variable
(string-split arg #\=)
+ result)))
+ (option '("free-space-requirement") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'free-space-requirement
+ (string->number arg)
result)))))
(define %default-options
@@ -109,7 +114,9 @@
(_ #f))
opts)
#:per-job-parallelism
- (assq-ref opts 'per-job-parallelism)))
- (lambda _
- (backtrace))))
+ (assq-ref opts 'per-job-parallelism)
+ #:free-space-requirement
+ (assq-ref opts 'free-space-requirement)))
+ (lambda _
+ (backtrace))))
#:unwind? #t))))