From e590ffcc3d22da103b4698f6abe128065bfced14 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 25 Aug 2023 09:19:04 +0100 Subject: Avoid take not working when there are less than 2 merge requests --- guix-qa-frontpage/manage-builds.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'guix-qa-frontpage') diff --git a/guix-qa-frontpage/manage-builds.scm b/guix-qa-frontpage/manage-builds.scm index 019c758..d3533f6 100644 --- a/guix-qa-frontpage/manage-builds.scm +++ b/guix-qa-frontpage/manage-builds.scm @@ -287,6 +287,11 @@ (simple-format #t "no derivation changes url for branch ~A\n" branch)))) +(define (take* lst n) + (if (< (length lst) n) + lst + (take lst n))) + (define (start-submit-branch-builds-thread database build-coordinator guix-data-service) @@ -340,7 +345,7 @@ (with-throw-handler #t (lambda () (let* ((branches - (take + (take* (filter (match-lambda ((name . details) -- cgit v1.2.3