diff options
author | Christopher Baines <mail@cbaines.net> | 2023-02-17 17:46:32 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-02-17 17:46:32 +0000 |
commit | 9ecef359dfe3dd1edf289165384708183fe3278d (patch) | |
tree | 10968489635f42b4af4361031afd0ee22e3886c2 /guix-qa-frontpage | |
parent | d8003e4d93d3d94f641109d0553be675005fdfbd (diff) | |
download | qa-frontpage-9ecef359dfe3dd1edf289165384708183fe3278d.tar qa-frontpage-9ecef359dfe3dd1edf289165384708183fe3278d.tar.gz |
Tweak and join up how many patch series are processed
By different parts of the code.
Diffstat (limited to 'guix-qa-frontpage')
-rw-r--r-- | guix-qa-frontpage/manage-builds.scm | 9 | ||||
-rw-r--r-- | guix-qa-frontpage/manage-patch-branches.scm | 5 | ||||
-rw-r--r-- | guix-qa-frontpage/server.scm | 19 |
3 files changed, 20 insertions, 13 deletions
diff --git a/guix-qa-frontpage/manage-builds.scm b/guix-qa-frontpage/manage-builds.scm index ccbfed5..2bc9268 100644 --- a/guix-qa-frontpage/manage-builds.scm +++ b/guix-qa-frontpage/manage-builds.scm @@ -26,9 +26,10 @@ "powerpc64le-linux" "i586-gnu")) -(define (start-submit-patch-builds-thread database - build-coordinator - guix-data-service) +(define* (start-submit-patch-builds-thread database + build-coordinator + guix-data-service + #:key (series-count 200)) (define (priority-for-change change) (if (member (assoc-ref change "system") '("x86_64-linux" "aarch64-linux")) @@ -101,7 +102,7 @@ #:priority priority-for-change)))) (simple-format #t "no derivation changes url for issue ~A\n" issue-number))))) - (take series 150)))) + (take series series-count)))) (call-with-new-thread (lambda () diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm index a03b3dc..c15f843 100644 --- a/guix-qa-frontpage/manage-patch-branches.scm +++ b/guix-qa-frontpage/manage-patch-branches.scm @@ -204,7 +204,8 @@ #:unwind? #t)) #:remove-after? #t))) -(define (start-manage-patch-branches-thread database) +(define* (start-manage-patch-branches-thread database + #:key (series-count 200)) (define (dig alist . parts) (if (pair? alist) (match parts @@ -272,7 +273,7 @@ (series-to-create-branches-for (let ((recent-series (take all-patchwork-series - 200))) + series-count))) (append recent-series (filter-map diff --git a/guix-qa-frontpage/server.scm b/guix-qa-frontpage/server.scm index 44a09ae..32c812c 100644 --- a/guix-qa-frontpage/server.scm +++ b/guix-qa-frontpage/server.scm @@ -53,7 +53,8 @@ start-refresh-patch-branches-data-thread start-refresh-non-patch-branches-data-thread)) -(define (make-controller assets-directory database metrics-registry) +(define* (make-controller assets-directory database metrics-registry + #:key (patch-issues-to-show 200)) (define handle-static-assets (if (string-prefix? (%store-prefix) @@ -172,8 +173,8 @@ (render-html #:sxml (patches-view (if (> (length sorted-latest-series) - 200) - (take sorted-latest-series 200) + patch-issues-to-show) + (take sorted-latest-series patch-issues-to-show) sorted-latest-series))))) (('GET "issue" (? (lambda (s) (string-suffix? ".svg" s)) number.svg)) (let* ((number @@ -418,9 +419,11 @@ has no patches or has been closed.") #:code 500)))) (define* (start-guix-qa-frontpage-web-server port host assets-directory - database metrics-registry) + database metrics-registry + #:key (controller-args '())) (define controller - (make-controller assets-directory database metrics-registry)) + (apply make-controller assets-directory database metrics-registry + controller-args)) (call-with-error-handling (lambda () @@ -442,8 +445,10 @@ Check if it's already running, or whether another process is using that port. Also, the port used can be changed by passing the --port option.\n" port))))))) -(define (start-refresh-patch-branches-data-thread database) - (define number-of-series-to-refresh 250) +(define* (start-refresh-patch-branches-data-thread + database + #:key + (number-of-series-to-refresh 250)) (define (refresh-data) (simple-format (current-error-port) |