From b8bfdcf622a00264936a952932296bc4f13bdf37 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 17 May 2021 18:35:19 +0100 Subject: Remove the "derivations using output" data From the HTML and JSON responses, since this data isn't very useful, and the query to collect the small amount which is displayed is very slow. This could return at some point, but in a proper paginated form which isn't slow. --- guix-data-service/web/controller.scm | 24 +++--------------------- guix-data-service/web/view/html.scm | 25 +++---------------------- 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index 5e10e41..60773ca 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -424,16 +424,7 @@ filename))))) #:extra-headers http-headers-for-unchanging-content)))) (derivations - (letpar& ((derivations-using-store-item-list - (with-thread-postgresql-connection - (lambda (conn) - (map (lambda (derivation) - (match derivation - ((file-name output-id rest ...) - (select-derivations-using-output - conn output-id)))) - derivations)))) - (nars + (letpar& ((nars (with-thread-postgresql-connection (lambda (conn) (select-nars-for-output conn filename)))) @@ -446,7 +437,6 @@ (render-html #:sxml (view-store-item filename derivations - derivations-using-store-item-list nars builds))))))) @@ -510,16 +500,8 @@ (map (match-lambda ((filename output-id) - `((filename . ,filename) - (derivations-using-store-item - . ,(list->vector - (map car - (parallel-via-thread-pool-channel - (with-thread-postgresql-connection - (lambda (conn) - (select-derivations-using-output - conn output-id)))))))))) - derivations)))))))))) + `((filename . ,filename)))) + derivations)))))))))) (define handle-static-assets (if assets-dir-in-store? diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 2093217..f22595b 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -450,7 +450,6 @@ (define (view-store-item filename derivations - derivations-using-store-item-list nars builds) (layout @@ -530,7 +529,7 @@ derivation-file-name))) ,(build-status-span status)))) builds))) - ,@(map (lambda (derivation derivations-using-store-item) + ,@(map (lambda (derivation) `((div (@ (class "row")) (div @@ -539,26 +538,8 @@ ,(match derivation ((file-name output-id) `(a (@ (href ,file-name)) - ,(display-store-item file-name)))))) - (div - (@ (class "row")) - (div - (@ (class "col-sm-12")) - (h2 "Derivations using this store item " - ,(let ((count (length derivations-using-store-item))) - (if (eq? count 100) - "(> 100)" - (simple-format #f "(~A)" count)))) - (ul - (@ (class "list-unstyled")) - ,(map - (match-lambda - ((file-name) - `(li (a (@ (href ,file-name)) - ,(display-store-item file-name))))) - derivations-using-store-item)))))) - derivations - derivations-using-store-item-list))))) + ,(display-store-item file-name)))))))) + derivations))))) (define (view-derivation-source-file filename details) (define labels -- cgit v1.2.3