diff options
Diffstat (limited to 'guix-qa-frontpage/server.scm')
-rw-r--r-- | guix-qa-frontpage/server.scm | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/guix-qa-frontpage/server.scm b/guix-qa-frontpage/server.scm index 02929b8..ce4b9ee 100644 --- a/guix-qa-frontpage/server.scm +++ b/guix-qa-frontpage/server.scm @@ -106,9 +106,20 @@ (render-html #:sxml (branches-view branches)))) + (('GET "branch" "master") + (let ((substitute-availability + (with-sqlite-cache + database + 'master-branch-data + master-branch-data + #:ttl 6000))) + (render-html + #:sxml + (master-branch-view substitute-availability)))) (('GET "branch" branch) (let ((change-details derivation-changes-counts + substitute-availability (with-sqlite-cache database 'branch-data @@ -120,7 +131,8 @@ #:sxml (branch-view branch change-details - derivation-changes-counts)))) + derivation-changes-counts + substitute-availability)))) (('GET "patches") (let* ((latest-series (with-sqlite-cache @@ -468,11 +480,32 @@ port. Also, the port used can be changed by passing the --port option.\n" (derivation-changes-counts (derivation-changes-counts derivation-changes-data - %systems-to-submit-builds-for))) + %systems-to-submit-builds-for)) + + (target-commit + (assoc-ref + (assoc-ref + (assoc-ref change-details "revisions") + "target") + "commit")) + + (substitute-availability + (package-substitute-availability + (package-substitute-availability-url + target-commit)))) (values change-details - derivation-changes-counts))) + derivation-changes-counts + substitute-availability))) + +(define* (master-branch-data) + (let* ((substitute-availability + (package-substitute-availability + "https://data.qa.guix.gnu.org/repository/2/branch/master/latest-processed-revision/package-substitute-availability.json"))) + + (values + substitute-availability))) (define* (start-refresh-patch-branches-data-thread database @@ -629,7 +662,13 @@ port. Also, the port used can be changed by passing the --port option.\n" #:ttl (/ frequency 2)))) #:unwind? #t) #t) - branches))) + branches)) + + (with-sqlite-cache + database + 'master-branch-data + master-branch-data + #:ttl 0)) (call-with-new-thread (lambda () |