diff options
author | Christopher Baines <mail@cbaines.net> | 2022-12-05 18:58:52 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-12-05 18:58:52 +0000 |
commit | a4641ab780d1002ef80c7464882ad667fe0ee87f (patch) | |
tree | d5cac791bdf8f3c3fb29193eba9914287a67a970 /guix-qa-frontpage/server.scm | |
parent | d5de7cf2caf8504a00cd1947df941a1e485bc9a3 (diff) | |
download | qa-frontpage-a4641ab780d1002ef80c7464882ad667fe0ee87f.tar qa-frontpage-a4641ab780d1002ef80c7464882ad667fe0ee87f.tar.gz |
Pull more get-issue-branch-base-and-target-refs calls out
Diffstat (limited to 'guix-qa-frontpage/server.scm')
-rw-r--r-- | guix-qa-frontpage/server.scm | 119 |
1 files changed, 68 insertions, 51 deletions
diff --git a/guix-qa-frontpage/server.scm b/guix-qa-frontpage/server.scm index 89d7941..fe3d344 100644 --- a/guix-qa-frontpage/server.scm +++ b/guix-qa-frontpage/server.scm @@ -314,62 +314,74 @@ #:ttl 1200) (string->number number)))) (if series - (let ((derivation-changes - change-details - (call-with-values - (lambda () - (and=> - (get-issue-branch-base-and-target-refs number) - (lambda (base-and-target-refs) - (with-exception-handler - (lambda (exn) - (simple-format - (current-error-port) - "exception fetching derivation changes: ~A\n" - exn) - - (values #f #f)) - (lambda () - (with-sqlite-cache - database - 'derivation-changes - patch-series-derivation-changes - #:args - (list - (patch-series-derivation-changes-url - base-and-target-refs - #:systems %systems-to-submit-builds-for)) - #:ttl 6000)) - #:unwind? #t)))) - (lambda res - (match res - ((#f) - (values #f #f)) - (_ (apply values res)))))) - (comparison-details - (and=> - (patch-series-compare-url number) - (lambda (url) - (with-exception-handler - (lambda (exn) - (if (guix-data-service-error? exn) - exn - (raise-exception exn))) + (let* ((derivation-changes + change-details + (call-with-values (lambda () - (with-sqlite-cache - database - 'lint-warnings - patch-series-comparison - #:args - (list url) - #:ttl 6000)) - #:unwind? #t))))) + (and=> + (with-sqlite-cache + database + 'issue-branch-base-and-target-refs + get-issue-branch-base-and-target-refs + #:args (list (string->number number)) + #:ttl 1200) + (lambda (base-and-target-refs) + (with-exception-handler + (lambda (exn) + (simple-format + (current-error-port) + "exception fetching derivation changes: ~A\n" + exn) + + (values #f #f)) + (lambda () + (with-sqlite-cache + database + 'derivation-changes + patch-series-derivation-changes + #:args + (list + (patch-series-derivation-changes-url + base-and-target-refs + #:systems %systems-to-submit-builds-for)) + #:ttl 6000)) + #:unwind? #t)))) + (lambda res + (match res + ((#f) + (values #f #f)) + (_ (apply values res)))))) + (base-and-target-refs + (get-issue-branch-base-and-target-refs + (string->number number))) + (comparison-details + (and=> + base-and-target-refs + (lambda (base-and-target-refs) + (with-exception-handler + (lambda (exn) + (if (guix-data-service-error? exn) + exn + (raise-exception exn))) + (lambda () + (with-sqlite-cache + database + 'lint-warnings + patch-series-comparison + #:args + (list (patch-series-compare-url + base-and-target-refs)) + #:ttl 6000)) + #:unwind? #t))))) (render-html #:sxml (issue-view number series (assq-ref (assq-ref series 'mumi) 'tags) - (patch-series-compare-url number #:json? #f) + (and base-and-target-refs + (patch-series-compare-url + base-and-target-refs + #:json? #f)) derivation-changes change-details comparison-details))) @@ -478,7 +490,12 @@ port. Also, the port used can be changed by passing the --port option.\n" #f) (lambda () (and=> - (get-issue-branch-base-and-target-refs (car series)) + (with-sqlite-cache + database + 'issue-branch-base-and-target-refs + get-issue-branch-base-and-target-refs + #:args (list (car series)) + #:ttl 1200) (lambda (base-and-target-refs) (with-sqlite-cache database |