Prioritise processing the latest revisions for branches

Reserve some capacity to process revisions which are the tip of a branch. This
should reduce the time between new revisions appearing, and then being
processed.
This commit is contained in:
Christopher Baines 2019-07-16 18:20:02 +01:00
parent 6904547bf2
commit 413ef9ea6e
2 changed files with 36 additions and 12 deletions

View file

@ -129,12 +129,17 @@
#f)
((jobs ...)
(for-each
(lambda (job-args)
(let ((current-processes
(hash-count (const #t) processes)))
(when (< current-processes
max-processes)
(fork-and-process-job job-args))))
(match-lambda
((job-id priority?)
(let ((current-processes
(hash-count (const #t) processes)))
(when (< current-processes
(if priority?
;; For priority jobs, burst up to twice the number
;; of max processes
(* 2 max-processes)
max-processes))
(fork-and-process-job (list job-id))))))
jobs)))
(unless (eq? 0 (sleep 15))
(exit 0))))