aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-16 19:57:56 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-16 19:57:56 +0000
commitc229ace8a5522b2c12559bb55fcc6d5abbeb8a55 (patch)
tree4e852c5188d99c259c3dc208f7de7c7a02ae4f16 /guix-data-service
parent96f897cf3b68058a3a487175788a5ab9acca1d53 (diff)
downloaddata-service-c229ace8a5522b2c12559bb55fcc6d5abbeb8a55.tar
data-service-c229ace8a5522b2c12559bb55fcc6d5abbeb8a55.tar.gz
Allow customising the maximum number of processes
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/jobs.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix-data-service/jobs.scm b/guix-data-service/jobs.scm
index 25097f8..dab91a5 100644
--- a/guix-data-service/jobs.scm
+++ b/guix-data-service/jobs.scm
@@ -2,9 +2,11 @@
#:use-module (ice-9 match)
#:use-module (ice-9 format)
#:use-module (guix-data-service jobs load-new-guix-revision)
- #:export (process-jobs))
+ #:export (process-jobs
-(define (process-jobs conn)
+ default-max-processes))
+
+(define* (process-jobs conn #:key max-processes)
(define (fetch-new-jobs)
(fetch-unlocked-jobs conn))
@@ -23,7 +25,8 @@
(process-jobs-concurrently fetch-new-jobs
process-job
- handle-job-failure))
+ handle-job-failure
+ #:max-processes max-processes))
(define default-max-processes
(max (round (/ (current-processor-count)