diff options
author | Christopher Baines <mail@cbaines.net> | 2024-06-21 15:08:37 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-06-21 15:29:34 +0100 |
commit | e6205e988ae95c5dca57cf257a90b87e06dd16a7 (patch) | |
tree | 4dbdca37bed2707e1777808d27fe8fc0e0c9447b /guix-data-service/web | |
parent | 4e7c2bcfbf847d4276c20153b26450a0cd2990af (diff) | |
download | data-service-e6205e988ae95c5dca57cf257a90b87e06dd16a7.tar data-service-e6205e988ae95c5dca57cf257a90b87e06dd16a7.tar.gz |
Speed up querying for revision package derivations
By splitting it up by system.
Diffstat (limited to 'guix-data-service/web')
-rw-r--r-- | guix-data-service/web/revision/controller.scm | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/guix-data-service/web/revision/controller.scm b/guix-data-service/web/revision/controller.scm index aa7f226..5aeed49 100644 --- a/guix-data-service/web/revision/controller.scm +++ b/guix-data-service/web/revision/controller.scm @@ -1069,8 +1069,8 @@ (assq-ref query-parameters 'field))) (letpar& ((derivations - (with-resource-from-pool (connection-pool) conn - (if search-query + (if search-query + (with-resource-from-pool (connection-pool) conn (search-package-derivations-in-revision conn commit-hash @@ -1088,24 +1088,31 @@ string->symbol) #:limit-results limit-results #:after-name (assq-ref query-parameters 'after_name) - #:include-builds? (member "builds" fields)) - (select-package-derivations-in-revision - conn - commit-hash - #:systems (assq-ref query-parameters 'system) - #:targets (assq-ref query-parameters 'target) - #:maximum-builds (assq-ref query-parameters 'maximum_builds) - #:minimum-builds (assq-ref query-parameters 'minimum_builds) - #:build-from-build-servers (assq-ref query-parameters - 'build_from_build_server) - #:no-build-from-build-servers (assq-ref query-parameters - 'no_build_from_build_server) - #:build-status (and=> (assq-ref query-parameters - 'build_status) - string->symbol) - #:limit-results limit-results - #:after-name (assq-ref query-parameters 'after_name) - #:include-builds? (member "builds" fields))))) + #:include-builds? (member "builds" fields))) + (concatenate! + (par-map& + (lambda (system) + (with-resource-from-pool (connection-pool) conn + (select-package-derivations-in-revision + conn + commit-hash + #:system system + #:targets (assq-ref query-parameters 'target) + #:maximum-builds (assq-ref query-parameters 'maximum_builds) + #:minimum-builds (assq-ref query-parameters 'minimum_builds) + #:build-from-build-servers (assq-ref query-parameters + 'build_from_build_server) + #:no-build-from-build-servers (assq-ref query-parameters + 'no_build_from_build_server) + #:build-status (and=> (assq-ref query-parameters + 'build_status) + string->symbol) + #:limit-results limit-results + #:after-name (assq-ref query-parameters 'after_name) + #:include-builds? (member "builds" fields)))) + (or (assq-ref query-parameters 'system) + (call-with-resource-from-pool (connection-pool) + list-systems)))))) (build-server-urls (call-with-resource-from-pool (connection-pool) select-build-server-urls-by-id))) |