Use fibers when processing new revisions
Just have one fiber at the moment, but this will enable using fibers for parallelism in the future. Fibers seemed to cause problems with the logging setup, which was a bit odd in the first place. So move logging to the parent process which is better anyway.
This commit is contained in:
parent
f5acc60288
commit
c3cb04cb80
6 changed files with 364 additions and 468 deletions
|
|
@ -25,6 +25,8 @@
|
|||
(use-modules (srfi srfi-1)
|
||||
(srfi srfi-37)
|
||||
(ice-9 match)
|
||||
(ice-9 suspendable-ports)
|
||||
(fibers)
|
||||
(guix-data-service database)
|
||||
(guix-data-service data-deletion)
|
||||
(guix-data-service model package-derivation-by-guix-revision-range)
|
||||
|
|
@ -38,12 +40,21 @@
|
|||
;; Make stack traces more useful
|
||||
(setenv "COLUMNS" "256")
|
||||
|
||||
(install-suspendable-ports!)
|
||||
|
||||
(define %options
|
||||
(list (option '("skip-system-tests") #f #f
|
||||
(lambda (opt name _ result)
|
||||
(alist-cons 'skip-system-tests #t result)))))
|
||||
(alist-cons 'skip-system-tests #t result)))
|
||||
(option '("parallelism") #t #f
|
||||
(lambda (opt name arg result)
|
||||
(alist-cons 'parallelism
|
||||
(string->number arg)
|
||||
(alist-delete 'parallelism
|
||||
result))))))
|
||||
|
||||
(define %default-options '())
|
||||
(define %default-options
|
||||
'((parallelism . 1)))
|
||||
|
||||
(define (parse-options args)
|
||||
(args-fold
|
||||
|
|
@ -62,6 +73,11 @@
|
|||
(let ((opts (parse-options (cdr (program-arguments)))))
|
||||
(match (assq-ref opts 'arguments)
|
||||
((job)
|
||||
(process-load-new-guix-revision-job
|
||||
job
|
||||
#:skip-system-tests? (assq-ref opts 'skip-system-tests)))))
|
||||
(run-fibers
|
||||
(lambda ()
|
||||
(process-load-new-guix-revision-job
|
||||
job
|
||||
#:skip-system-tests? (assq-ref opts 'skip-system-tests)))
|
||||
#:hz 0
|
||||
#:parallelism (assq-ref opts 'parallelism)
|
||||
#:drain? #t))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue