diff options
author | Christopher Baines <mail@cbaines.net> | 2024-05-18 10:24:57 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-05-18 10:24:57 +0100 |
commit | 1b5630ec7f37f0b828317b0eac1b69a796726068 (patch) | |
tree | 8e3616b11f771a08011e55723da75ccefa4d7c3d | |
parent | 361098bc5fb6fe3f9debcfd71e44d0aa48f57aad (diff) | |
download | qa-frontpage-1b5630ec7f37f0b828317b0eac1b69a796726068.tar qa-frontpage-1b5630ec7f37f0b828317b0eac1b69a796726068.tar.gz |
Cache series entries for each individual issue
So that you don't have to load the whole list from the cache each time.
-rw-r--r-- | guix-qa-frontpage/issue.scm | 11 | ||||
-rw-r--r-- | guix-qa-frontpage/patchwork.scm | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/guix-qa-frontpage/issue.scm b/guix-qa-frontpage/issue.scm index 94267a5..eacd6e0 100644 --- a/guix-qa-frontpage/issue.scm +++ b/guix-qa-frontpage/issue.scm @@ -328,6 +328,17 @@ (take latest-series number-of-series-to-refresh) latest-series))) + (for-each + (match-lambda + ((issue-number . data) + (with-sqlite-cache + database + 'latest-patchwork-series-for-issue + (const data) + #:args (list issue-number) + #:ttl 0))) + latest-series) + (non-blocking (lambda () (update-repository!))) diff --git a/guix-qa-frontpage/patchwork.scm b/guix-qa-frontpage/patchwork.scm index 049012f..cb91e30 100644 --- a/guix-qa-frontpage/patchwork.scm +++ b/guix-qa-frontpage/patchwork.scm @@ -320,6 +320,6 @@ series-by-issue-number mumi-data))))))) - - - +(define (latest-patchwork-series-for-issue issue-number #:key patchwork) + (assq-ref (latest-patchwork-series-by-issue #:patchwork patchwork) + issue-number)) |